Wulingtian / yolov5_onnx2caffe

yolov5 onnx caffe
113 stars 37 forks source link

模型转换遇到错误 error #9

Open JensenHJS opened 3 years ago

JensenHJS commented 3 years ago

将自己的sim-onnx模型转caffe模型时遇到如下错误: 另外还想问一下,博主的caffe测试版本是否跟BVLC的caffe版本有所区别? {'images': 3, '167': 3, '168': 32, '169': 32, '170': 32, '171': 64, '172': 64, '173': 64, '174': 32, '175': 32, '176': 32, '177': 32, '178': 32, '179': 32, '180': 32, '181': 32, '182': 32} {'images': 3, '167': 3, '168': 32, '169': 32, '170': 32, '171': 64, '172': 64, '173': 64, '174': 32, '175': 32, '176': 32, '177': 32, '178': 32, '179': 32, '180': 32, '181': 32, '182': 32} {'images': 3, '167': 3, '168': 32, '169': 32, '170': 32, '171': 64, '172': 64, '173': 64, '174': 32, '175': 32, '176': 32, '177': 32, '178': 32, '179': 32, '180': 32, '181': 32, '182': 32, '183': 32, '184': 32, '185': 32, '186': 32, '187': 64, '188': 64, '189': 64, '190': 64, '191': 128, '192': 128, '193': 128, '194': 64, '195': 64, '196': 64, '197': 64, '198': 64, '199': 64, '200': 64, '201': 64, '202': 64} {'images': 3, '167': 3, '168': 32, '169': 32, '170': 32, '171': 64, '172': 64, '173': 64, '174': 32, '175': 32, '176': 32, '177': 32, '178': 32, '179': 32, '180': 32, '181': 32, '182': 32, '183': 32, '184': 32, '185': 32, '186': 32, '187': 64, '188': 64, '189': 64, '190': 64, '191': 128, '192': 128, '193': 128, '194': 64, '195': 64, '196': 64, '197': 64, '198': 64, '199': 64, '200': 64, '201': 64, '202': 64} {'images': 3, '167': 3, '168': 32, '169': 32, '170': 32, '171': 64, '172': 64, '173': 64, '174': 32, '175': 32, '176': 32, '177': 32, '178': 32, '179': 32, '180': 32, '181': 32, '182': 32, '183': 32, '184': 32, '185': 32, '186': 32, '187': 64, '188': 64, '189': 64, '190': 64, '191': 128, '192': 128, '193': 128, '194': 64, '195': 64, '196': 64, '197': 64, '198': 64, '199': 64, '200': 64, '201': 64, '202': 64, '203': 64, '204': 64, '205': 64, '206': 64, '207': 64, '208': 64, '209': 64} {'images': 3, '167': 3, '168': 32, '169': 32, '170': 32, '171': 64, '172': 64, '173': 64, '174': 32, '175': 32, '176': 32, '177': 32, '178': 32, '179': 32, '180': 32, '181': 32, '182': 32, '183': 32, '184': 32, '185': 32, '186': 32, '187': 64, '188': 64, '189': 64, '190': 64, '191': 128, '192': 128, '193': 128, '194': 64, '195': 64, '196': 64, '197': 64, '198': 64, '199': 64, '200': 64, '201': 64, '202': 64, '203': 64, '204': 64, '205': 64, '206': 64, '207': 64, '208': 64, '209': 64} {'images': 3, '167': 3, '168': 32, '169': 32, '170': 32, '171': 64, '172': 64, '173': 64, '174': 32, '175': 32, '176': 32, '177': 32, '178': 32, '179': 32, '180': 32, '181': 32, '182': 32, '183': 32, '184': 32, '185': 32, '186': 32, '187': 64, '188': 64, '189': 64, '190': 64, '191': 128, '192': 128, '193': 128, '194': 64, '195': 64, '196': 64, '197': 64, '198': 64, '199': 64, '200': 64, '201': 64, '202': 64, '203': 64, '204': 64, '205': 64, '206': 64, '207': 64, '208': 64, '209': 64, '210': 64, '211': 64, '212': 64, '213': 64, '214': 64, '215': 64, '216': 64} {'images': 3, '167': 3, '168': 32, '169': 32, '170': 32, '171': 64, '172': 64, '173': 64, '174': 32, '175': 32, '176': 32, '177': 32, '178': 32, '179': 32, '180': 32, '181': 32, '182': 32, '183': 32, '184': 32, '185': 32, '186': 32, '187': 64, '188': 64, '189': 64, '190': 64, '191': 128, '192': 128, '193': 128, '194': 64, '195': 64, '196': 64, '197': 64, '198': 64, '199': 64, '200': 64, '201': 64, '202': 64, '203': 64, '204': 64, '205': 64, '206': 64, '207': 64, '208': 64, '209': 64, '210': 64, '211': 64, '212': 64, '213': 64, '214': 64, '215': 64, '216': 64} {'images': 3, '167': 3, '168': 32, '169': 32, '170': 32, '171': 64, '172': 64, '173': 64, '174': 32, '175': 32, '176': 32, '177': 32, '178': 32, '179': 32, '180': 32, '181': 32, '182': 32, '183': 32, '184': 32, '185': 32, '186': 32, '187': 64, '188': 64, '189': 64, '190': 64, '191': 128, '192': 128, '193': 128, '194': 64, '195': 64, '196': 64, '197': 64, '198': 64, '199': 64, '200': 64, '201': 64, '202': 64, '203': 64, '204': 64, '205': 64, '206': 64, '207': 64, '208': 64, '209': 64, '210': 64, '211': 64, '212': 64, '213': 64, '214': 64, '215': 64, '216': 64, '217': 64, '218': 64, '219': 64, '220': 64, '221': 128, '222': 128, '223': 128, '224': 128, '225': 256, '226': 256, '227': 256, '228': 128, '229': 128, '230': 128, '231': 128, '232': 128, '233': 128, '234': 128, '235': 128, '236': 128} {'images': 3, '167': 3, '168': 32, '169': 32, '170': 32, '171': 64, '172': 64, '173': 64, '174': 32, '175': 32, '176': 32, '177': 32, '178': 32, '179': 32, '180': 32, '181': 32, '182': 32, '183': 32, '184': 32, '185': 32, '186': 32, '187': 64, '188': 64, '189': 64, '190': 64, '191': 128, '192': 128, '193': 128, '194': 64, '195': 64, '196': 64, '197': 64, '198': 64, '199': 64, '200': 64, '201': 64, '202': 64, '203': 64, '204': 64, '205': 64, '206': 64, '207': 64, '208': 64, '209': 64, '210': 64, '211': 64, '212': 64, '213': 64, '214': 64, '215': 64, '216': 64, '217': 64, '218': 64, '219': 64, '220': 64, '221': 128, '222': 128, '223': 128, '224': 128, '225': 256, '226': 256, '227': 256, '228': 128, '229': 128, '230': 128, '231': 128, '232': 128, '233': 128, '234': 128, '235': 128, '236': 128} {'images': 3, '167': 3, '168': 32, '169': 32, '170': 32, '171': 64, '172': 64, '173': 64, '174': 32, '175': 32, '176': 32, '177': 32, '178': 32, '179': 32, '180': 32, '181': 32, '182': 32, '183': 32, '184': 32, '185': 32, '186': 32, '187': 64, '188': 64, '189': 64, '190': 64, '191': 128, '192': 128, '193': 128, '194': 64, '195': 64, '196': 64, '197': 64, '198': 64, '199': 64, '200': 64, '201': 64, '202': 64, '203': 64, '204': 64, '205': 64, '206': 64, '207': 64, '208': 64, '209': 64, '210': 64, '211': 64, '212': 64, '213': 64, '214': 64, '215': 64, '216': 64, '217': 64, '218': 64, '219': 64, '220': 64, '221': 128, '222': 128, '223': 128, '224': 128, '225': 256, '226': 256, '227': 256, '228': 128, '229': 128, '230': 128, '231': 128, '232': 128, '233': 128, '234': 128, '235': 128, '236': 128, '237': 128, '238': 128, '239': 128, '240': 128, '241': 128, '242': 128, '243': 128} {'images': 3, '167': 3, '168': 32, '169': 32, '170': 32, '171': 64, '172': 64, '173': 64, '174': 32, '175': 32, '176': 32, '177': 32, '178': 32, '179': 32, '180': 32, '181': 32, '182': 32, '183': 32, '184': 32, '185': 32, '186': 32, '187': 64, '188': 64, '189': 64, '190': 64, '191': 128, '192': 128, '193': 128, '194': 64, '195': 64, '196': 64, '197': 64, '198': 64, '199': 64, '200': 64, '201': 64, '202': 64, '203': 64, '204': 64, '205': 64, '206': 64, '207': 64, '208': 64, '209': 64, '210': 64, '211': 64, '212': 64, '213': 64, '214': 64, '215': 64, '216': 64, '217': 64, '218': 64, '219': 64, '220': 64, '221': 128, '222': 128, '223': 128, '224': 128, '225': 256, '226': 256, '227': 256, '228': 128, '229': 128, '230': 128, '231': 128, '232': 128, '233': 128, '234': 128, '235': 128, '236': 128, '237': 128, '238': 128, '239': 128, '240': 128, '241': 128, '242': 128, '243': 128} {'images': 3, '167': 3, '168': 32, '169': 32, '170': 32, '171': 64, '172': 64, '173': 64, '174': 32, '175': 32, '176': 32, '177': 32, '178': 32, '179': 32, '180': 32, '181': 32, '182': 32, '183': 32, '184': 32, '185': 32, '186': 32, '187': 64, '188': 64, '189': 64, '190': 64, '191': 128, '192': 128, '193': 128, '194': 64, '195': 64, '196': 64, '197': 64, '198': 64, '199': 64, '200': 64, '201': 64, '202': 64, '203': 64, '204': 64, '205': 64, '206': 64, '207': 64, '208': 64, '209': 64, '210': 64, '211': 64, '212': 64, '213': 64, '214': 64, '215': 64, '216': 64, '217': 64, '218': 64, '219': 64, '220': 64, '221': 128, '222': 128, '223': 128, '224': 128, '225': 256, '226': 256, '227': 256, '228': 128, '229': 128, '230': 128, '231': 128, '232': 128, '233': 128, '234': 128, '235': 128, '236': 128, '237': 128, '238': 128, '239': 128, '240': 128, '241': 128, '242': 128, '243': 128, '244': 128, '245': 128, '246': 128, '247': 128, '248': 128, '249': 128, '250': 128} {'images': 3, '167': 3, '168': 32, '169': 32, '170': 32, '171': 64, '172': 64, '173': 64, '174': 32, '175': 32, '176': 32, '177': 32, '178': 32, '179': 32, '180': 32, '181': 32, '182': 32, '183': 32, '184': 32, '185': 32, '186': 32, '187': 64, '188': 64, '189': 64, '190': 64, '191': 128, '192': 128, '193': 128, '194': 64, '195': 64, '196': 64, '197': 64, '198': 64, '199': 64, '200': 64, '201': 64, '202': 64, '203': 64, '204': 64, '205': 64, '206': 64, '207': 64, '208': 64, '209': 64, '210': 64, '211': 64, '212': 64, '213': 64, '214': 64, '215': 64, '216': 64, '217': 64, '218': 64, '219': 64, '220': 64, '221': 128, '222': 128, '223': 128, '224': 128, '225': 256, '226': 256, '227': 256, '228': 128, '229': 128, '230': 128, '231': 128, '232': 128, '233': 128, '234': 128, '235': 128, '236': 128, '237': 128, '238': 128, '239': 128, '240': 128, '241': 128, '242': 128, '243': 128, '244': 128, '245': 128, '246': 128, '247': 128, '248': 128, '249': 128, '250': 128} Traceback (most recent call last): File "convertCaffe.py", line 155, in convertToCaffe(graph, prototxt_path, caffemodel_path, exis_focus=True, focus_concat_name="Concat_40", focus_conv_name="Conv_41") File "convertCaffe.py", line 83, in convertToCaffe layer = converter_fn(node, graph, err) File "/home/hjs/yolov5_onnx2caffe/onnx2caffe/_operators.py", line 134, in _convert_sigmoid graph.channel_dims[output_name] = graph.channel_dims[input_name] KeyError: '395'

wllkk commented 3 years ago

你好,我遇到了和你一样的错误,请问您解决了吗,谢谢?

JensenHJS commented 3 years ago

前两天才提的issue,还没解决

wllkk commented 3 years ago

前两天才提的issue,还没解决

嗯嗯,好的,我使用作者的 issue 中 #3 提供的模型是可以转换成功的。激活函数同样是sigmoid。我再仔细看一下。

sunzhongwu commented 3 years ago

我也遇到了,解决办法在.pt文件转换onnx的时候加上--train; eg:"python ./models/export.py --weights ./models/.pt --img-size --batch 1 --opset-version 10 --train";可以这样尝试能不能解决KeyError: '395'的错误

wllkk commented 3 years ago

我也遇到了,解决办法在.pt文件转换onnx的时候加上--train; eg:"python ./models/export.py --weights ./models/.pt --img-size --batch 1 --opset-version 10 --train";可以这样尝试能不能解决KeyError: '395'的错误

感谢,通过加上--train,去掉了网络结构最后的后处理部分,转换成功了。

littlemww commented 3 years ago

我加上--train之后生成.onnx,再进行simplify简化的时候,会报错

onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/providers/cpu/nn/batch_norm.h:52 onnxruntime::BatchNorm::BatchNorm(const onnxruntime::OpKernelInfo&) [with T = float] !istrain was false. Training mode is not supported in this build.

请问你们有没有遇到这个问题,是怎么解决的呀

littlemww commented 3 years ago

我也遇到了,解决办法在.pt文件转换onnx的时候加上--train; eg:"python ./models/export.py --weights ./models/.pt --img-size --batch 1 --opset-version 10 --train";可以这样尝试能不能解决KeyError: '395'的错误

你好,我用python export.py --train 解决了“graph.channel_dims[output_name] = graph.channel_dims[input_name] KeyError: '395'”的错误,但是onnx转换生成的caffe模型推理效果很差,请问你有没有遇到这个情况,是不是因为使用--train去掉了检测层的原因呢,请问你在生成caffe模型之前还有没有做过什么修改吗

jinduoxia commented 3 years ago

我加上--train之后生成.onnx,再进行simplify简化的时候,会报错

onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/providers/cpu/nn/batch_norm.h:52 onnxruntime::BatchNorm::BatchNorm(const onnxruntime::OpKernelInfo&) [with T = float] !istrain was false. Training mode is not supported in this build.

请问你们有没有遇到这个问题,是怎么解决的呀

这个问题我也碰到了,请问你是怎么解决的?

lsm1993 commented 3 years ago

抱歉,我没有遇到这个问题,是版本的问题么?onnx及其简化库是否是按照作者要求配置的呢?

------------------ Original ------------------ From: "Wulingtian/yolov5_onnx2caffe" @.>; Date: Tue, Aug 31, 2021 10:27 AM @.>; @.***>; Subject: Re: [Wulingtian/yolov5_onnx2caffe] 模型转换遇到错误 error (#9)

我加上--train之后生成.onnx,再进行simplify简化的时候,会报错

onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/providers/cpu/nn/batch_norm.h:52 onnxruntime::BatchNorm::BatchNorm(const onnxruntime::OpKernelInfo&) [with T = float] !istrain was false. Training mode is not supported in this build.

请问你们有没有遇到这个问题,是怎么解决的呀

这个问题我也碰到了,请问你是怎么解决的?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

littlemww commented 3 years ago

抱歉,我没有遇到这个问题,是版本的问题么?onnx及其简化库是否是按照作者要求配置的呢? ------------------ Original ------------------ From: "Wulingtian/yolov5_onnx2caffe" @.>; Date: Tue, Aug 31, 2021 10:27 AM @.>; @.***>; Subject: Re: [Wulingtian/yolov5_onnx2caffe] 模型转换遇到错误 error (#9) 我加上--train之后生成.onnx,再进行simplify简化的时候,会报错 onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/providers/cpu/nn/batch_norm.h:52 onnxruntime::BatchNorm::BatchNorm(const onnxruntime::OpKernelInfo&) [with T = float] !istrain was false. Training mode is not supported in this build. 请问你们有没有遇到这个问题,是怎么解决的呀 这个问题我也碰到了,请问你是怎么解决的? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

请问您是否知道在运行export.py时,加上--train和不加的区别是什么,我看到加上之后输出的onnx模型比没有加的时候少了后处理的模块,这样会影响在caffe上的结果吗?

littlemww commented 3 years ago

我加上--train之后生成.onnx,再进行simplify简化的时候,会报错

onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/providers/cpu/nn/batch_norm.h:52 onnxruntime::BatchNorm::BatchNorm(const onnxruntime::OpKernelInfo&) [with T = float] !istrain was false. Training mode is not supported in this build.

请问你们有没有遇到这个问题,是怎么解决的呀

这个问题我也碰到了,请问你是怎么解决的?

我把focus模块换成卷积模块的时候出现了这个问题,后来我就直接用focus模块了,就没有这个问题了,作者提供的caffe是支持focus的

lsm1993 commented 3 years ago

我猜测是没有后续检测的部分吧,应该不会吧,精度降低我觉得主要是模型转换过程中产生的问题吧

------------------ Original ------------------ From: "Wulingtian/yolov5_onnx2caffe" @.>; Date: Tue, Aug 31, 2021 10:51 AM @.>; @.**@.>; Subject: Re: [Wulingtian/yolov5_onnx2caffe] 模型转换遇到错误 error (#9)

抱歉,我没有遇到这个问题,是版本的问题么?onnx及其简化库是否是按照作者要求配置的呢? … ------------------ Original ------------------ From: "Wulingtian/yolov5_onnx2caffe" @.>; Date: Tue, Aug 31, 2021 10:27 AM @.>; @.***>; Subject: Re: [Wulingtian/yolov5_onnx2caffe] 模型转换遇到错误 error (#9) 我加上--train之后生成.onnx,再进行simplify简化的时候,会报错 onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/providers/cpu/nn/batch_norm.h:52 onnxruntime::BatchNorm::BatchNorm(const onnxruntime::OpKernelInfo&) [with T = float] !istrain was false. Training mode is not supported in this build. 请问你们有没有遇到这个问题,是怎么解决的呀 这个问题我也碰到了,请问你是怎么解决的? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

请问您是否知道在运行export.py时,加上--train和不加的区别是什么,我看到加上之后输出的onnx模型比没有加的时候少了后处理的模块,这样会影响在caffe上的结果吗?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

lsm1993 commented 3 years ago

我想问下你转换的时候把原始的yolov5和yolov5_git 中的yolov5s.yaml中的focus换成conv这样的吗?

------------------ Original ------------------ From: "Wulingtian/yolov5_onnx2caffe" @.>; Date: Tue, Aug 31, 2021 10:53 AM @.>; @.**@.>; Subject: Re: [Wulingtian/yolov5_onnx2caffe] 模型转换遇到错误 error (#9)

我加上--train之后生成.onnx,再进行simplify简化的时候,会报错

onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/providers/cpu/nn/batch_norm.h:52 onnxruntime::BatchNorm::BatchNorm(const onnxruntime::OpKernelInfo&) [with T = float] !istrain was false. Training mode is not supported in this build.

请问你们有没有遇到这个问题,是怎么解决的呀

这个问题我也碰到了,请问你是怎么解决的?

我把focus模块换成卷积模块的时候出现了这个问题,后来我就直接用focus模块了,就没有这个问题了,作者提供的caffe是支持focus的

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

littlemww commented 3 years ago

我想问下你转换的时候把原始的yolov5和yolov5_git 中的yolov5s.yaml中的focus换成conv这样的吗? ------------------ Original ------------------ From: "Wulingtian/yolov5_onnx2caffe" @.>; Date: Tue, Aug 31, 2021 10:53 AM @.>; @.**@.>; Subject: Re: [Wulingtian/yolov5_onnx2caffe] 模型转换遇到错误 error (#9) 我加上--train之后生成.onnx,再进行simplify简化的时候,会报错 onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/providers/cpu/nn/batch_norm.h:52 onnxruntime::BatchNorm::BatchNorm(const onnxruntime::OpKernelInfo&) [with T = float] !istrain was false. Training mode is not supported in this build. 请问你们有没有遇到这个问题,是怎么解决的呀 这个问题我也碰到了,请问你是怎么解决的? 我把focus模块换成卷积模块的时候出现了这个问题,后来我就直接用focus模块了,就没有这个问题了,作者提供的caffe是支持focus的 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

我把focus换成了这种形式:

[-1, 1, Conv, [64, 3, 2]], [-1, 3, C3, [64]], 但是这样会报错,就直接用focus了,请问这样改有什么问题吗

jinduoxia commented 3 years ago

我加上--train之后生成.onnx,再进行simplify简化的时候,会报错

onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/providers/cpu/nn/batch_norm.h:52 onnxruntime::BatchNorm::BatchNorm(const onnxruntime::OpKernelInfo&) [with T = float] !istrain was false. Training mode is not supported in this build.

请问你们有没有遇到这个问题,是怎么解决的呀

这个问题我也碰到了,请问你是怎么解决的?

我把focus模块换成卷积模块的时候出现了这个问题,后来我就直接用focus模块了,就没有这个问题了,作者提供的caffe是支持focus的

感谢,将focus替换回来后,就转换正常了。

sunzhongwu commented 3 years ago

我没有改动网络结构

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年8月31日(星期二) 中午11:18 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [Wulingtian/yolov5_onnx2caffe] 模型转换遇到错误 error (#9)

我想问下你转换的时候把原始的yolov5和yolov5_git 中的yolov5s.yaml中的focus换成conv这样的吗? … ------------------ Original ------------------ From: "Wulingtian/yolov5_onnx2caffe" @.>; Date: Tue, Aug 31, 2021 10:53 AM @.>; @.@.>; Subject: Re: [Wulingtian/yolov5_onnx2caffe] 模型转换遇到错误 error (#9) 我加上--train之后生成.onnx,再进行simplify简化的时候,会报错 onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/providers/cpu/nn/batch_norm.h:52 onnxruntime::BatchNorm::BatchNorm(const onnxruntime::OpKernelInfo&) [with T = float] !istrain was false. Training mode is not supported in this build. 请问你们有没有遇到这个问题,是怎么解决的呀 这个问题我也碰到了,请问你是怎么解决的? 我把focus模块换成卷积模块的时候出现了这个问题,后来我就直接用focus模块了,就没有这个问题了,作者提供的caffe是支持focus的 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

我把focus换成了这种形式:

[-1, 1, Conv, [64, 3, 2]], [-1, 3, C3, [64]], 但是这样会报错,就直接用focus了,请问这样改有什么问题吗

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

lsm1993 commented 3 years ago

应该不会,方便加个微信么?我之前也改了但是没遇见你这个问题,后面部署在其他硬件的时候出现了问题

------------------ Original ------------------ From: "Wulingtian/yolov5_onnx2caffe" @.>; Date: Tue, Aug 31, 2021 11:19 AM @.>; @.**@.>; Subject: Re: [Wulingtian/yolov5_onnx2caffe] 模型转换遇到错误 error (#9)

我没有改动网络结构

------------------ 原始邮件 ------------------ 发件人: @.>;
发送时间: 2021年8月31日(星期二) 中午11:18 收件人:
@.>;
抄送: @.>; @.>;
主题: Re: [Wulingtian/yolov5_onnx2caffe] 模型转换遇到错误 error (#9)

我想问下你转换的时候把原始的yolov5和yolov5_git 中的yolov5s.yaml中的focus换成conv这样的吗? … ------------------ Original ------------------ From: "Wulingtian/yolov5_onnx2caffe" @.>; Date: Tue, Aug 31, 2021 10:53 AM @.>; @.@.>; Subject: Re: [Wulingtian/yolov5_onnx2caffe] 模型转换遇到错误 error (#9) 我加上--train之后生成.onnx,再进行simplify简化的时候,会报错 onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/providers/cpu/nn/batch_norm.h:52 onnxruntime::BatchNorm::BatchNorm(const onnxruntime::OpKernelInfo&) [with T = float] !istrain was false. Training mode is not supported in this build. 请问你们有没有遇到这个问题,是怎么解决的呀 这个问题我也碰到了,请问你是怎么解决的? 我把focus模块换成卷积模块的时候出现了这个问题,后来我就直接用focus模块了,就没有这个问题了,作者提供的caffe是支持focus的 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

我把focus换成了这种形式:

[-1, 1, Conv, [64, 3, 2]], [-1, 3, C3, [64]], 但是这样会报错,就直接用focus了,请问这样改有什么问题吗

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

sunzhongwu commented 3 years ago

focus 转换为caffe部署到其他平台要看支持这个op不,不支持就转换为其他操作例如conv,"https://zhuanlan.zhihu.com/p/350860351"这篇帖子上有部署到hisi上的一点指导,可能还有坑哦

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年8月31日(星期二) 中午11:22 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [Wulingtian/yolov5_onnx2caffe] 模型转换遇到错误 error (#9)

应该不会,方便加个微信么?我之前也改了但是没遇见你这个问题,后面部署在其他硬件的时候出现了问题

------------------ Original ------------------ From: "Wulingtian/yolov5_onnx2caffe" @.>; Date: Tue, Aug 31, 2021 11:19 AM @.>; @.**@.>; Subject: Re: [Wulingtian/yolov5_onnx2caffe] 模型转换遇到错误 error (#9)

我没有改动网络结构

------------------ 原始邮件 ------------------
发件人: @.>;
发送时间: 2021年8月31日(星期二) 中午11:18
收件人:
@.>;
抄送: @.>; @.>;
主题: Re: [Wulingtian/yolov5_onnx2caffe] 模型转换遇到错误 error (#9)

我想问下你转换的时候把原始的yolov5和yolov5_git 中的yolov5s.yaml中的focus换成conv这样的吗?

------------------ Original ------------------ From: "Wulingtian/yolov5_onnx2caffe" @.>; Date: Tue, Aug 31, 2021 10:53 AM @.>; @.@.>; Subject: Re: [Wulingtian/yolov5_onnx2caffe] 模型转换遇到错误 error (#9) 我加上--train之后生成.onnx,再进行simplify简化的时候,会报错 onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/providers/cpu/nn/batch_norm.h:52 onnxruntime::BatchNorm::BatchNorm(const onnxruntime::OpKernelInfo&) [with T = float] !istrain was false. Training mode is not supported in this build. 请问你们有没有遇到这个问题,是怎么解决的呀 这个问题我也碰到了,请问你是怎么解决的? 我把focus模块换成卷积模块的时候出现了这个问题,后来我就直接用focus模块了,就没有这个问题了,作者提供的caffe是支持focus的 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

我把focus换成了这种形式:

[-1, 1, Conv, [64, 3, 2]],
[-1, 3, C3, [64]],
但是这样会报错,就直接用focus了,请问这样改有什么问题吗


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

lsm1993 commented 2 years ago

This is an automatic reply, confirming that your email was received.I will reply as soon as possible.Thank youSiming Lian

huangzongmou commented 2 years ago

This is an automatic reply, confirming that your email was received.I will reply as soon as possible.Thank youSiming Lian

你好,请问能加个微信么,我用6.0版本想请教几个问题。万分感谢。微信号:hzm201306AF

dengxiongshi commented 2 years ago

This is an automatic reply, confirming that your email was received.I will reply as soon as possible.Thank youSiming Lian

你好,请问能加个微信么,我用6.0版本想请教几个问题。万分感谢。微信号:hzm201306AF

我也是6.0版本,请问您解决了吗

lsm1993 commented 2 years ago

This is an automatic reply, confirming that your email was received.I will reply as soon as possible.Thank youSiming Lian

huangzongmou commented 2 years ago

您好!您的邮件已收到,尽快给你回复。谢谢                                                      黄总谋!