runtime_arm仿真阶段, std::exp函数报错

环境:

Ubuntu16

镜像版本为docker.hobot.cc/aitools/horizon_xj3_tc xj3_1.1.21i f5a413d7f9c9 7 weeks ago 2.31GB

问题描述:自己编写的nms算法,里面调用了exp函数用来计算输出的sigmoid,在runtime_sim中编译没有任何问题,能正常输出结果。

而在runtime_arm中编译报错,报错内容如下:

报错代码段:

            for (int w = 0; w < width; ++w) {                float * cur_data = data + width * h + w;                // yolact_nms need add scale_ parameters                float scale_ = 1000/138;                if (w*scale_< input[i].bbox.xmin || w*scale_ > input[i].bbox.xmax || h*scale_ < input[i].bbox.ymin || h*scale_ > input[i].bbox.ymax){                    continue;                }                double temp = 0.0;                for (int c = 0; c < channel; c++) {                    float* cur_data_ = cur_data + c*height*width;                    temp = temp + ((*cur_data_) * input[i].coeff[c]);                }                temp = 1 / (1 + std::exp(-temp));                mask[width * h + w] = (temp>mask_threshold)?1:0;            }

另外,源码中在yolo5后处理文件中也使用了std::exp函数,但是此处并没有报错,代码段如下:

        float objness = cur_data[4];        for (int index = 0; index < num_classes; ++index) {          class_pred[index] = cur_data[5 + index];        }        float id = argmax(class_pred.begin(), class_pred.end());        double x1 = 1 / (1 + std::exp(-objness)) * 1;        double x2 = 1 / (1 + std::exp(-class_pred[id]));        double confidence = x1 * x2;        if (confidence < score_threshold_) {          continue;        }

问题解决了,需要添加#include 文件,但是出现这种差异的原因是什么呢?

x86仿真环境和arm环境不一样哇