build时候的警告

yolov5模型,我在mapper里面进行build.sh的时候,出现以下警告。我知道不是错误,也知道这个警告的意思,但是这个是什么原因呢?表现在代码的哪里呢?

--------------------------------------------------------------------------------------------------------------------------------

2020-12-25 17:58:26.975138233 [E:onnxruntime:, sequential_executor.cc:165 Execute] Non-zero status code returned while running Reshape node. Name:‘Reshape_246’ Status Message: /home/jenkins/workspace/model_convert/onnxruntime/onnxruntime/core/providers/cpu/tensor/reshape_helper.h:43 onnxruntime::ReshapeHelper::ReshapeHelper(const onnxruntime::TensorShape&, std::vector&) gsl::narrow_cast<int64_t>(input_shape.Size()) == size was false. The input tensor cannot be reshaped to the requested shape. Input shape:{8,75,21,21}, requested shape:{1,3,25,21,21}

Stacktrace:

2020-12-25 17:58:26,975 WARNING [Warning]: Error when execute ONNXRuntime with batch_size=8 during calibration phase

Hi你好,这个是ONNXRuntime内部对batch_size支持欠缺导致的,并不影响工具链的编译过程哈。

如果对原理感兴趣,这个报错的原理简单解释是这样的:

在校准过程中,为了加快校准速度,我们用了batch_size=8,而ONNXRuntime遇到如Reshape节点尤其是reshape节点将featuremap的维度从四维增加到更多维度时,ONNXRuntime对batch模式的支持是不友好的会报错。所以我们catch这个error然后重新用batch_size=1进行,这样会导致校准稍微更耗时了一点,不过对整个工具链的编译运行没有任何影响的~

你好,这个问题已经转研发分析。