.pth转.onnx报错:RuntimeError: Only tuples, lists and Variables supported as JIT inputs, but got dict

项目场景:

最近在弄一个项目,用到了CenterNet网络(主干网络选择的是resnet,非DCN模块),转化模型一直出错:
.pth转.onnx报错:RuntimeError: Only tuples, lists and Variables supported as JIT inputs, but got dict_第1张图片
经过多次试验,是pytorch版本太低导致的,开始用的pytorch1.2一直出错,后面用pytorch1.9后成功转化模型。

后续,会更新详细的转换模型中需要注意的事项,以及opencv的dnn模块加载.onnx模型进行模型推理的整体过程。

你可能感兴趣的:(pytorch,pytorch)