天天看點

onnx resize層轉換報錯,TypeError: 1.0 has type numpy.float32, but expected one of: int

系統環境:onnx=1.6.0

onnx轉換時,resize層報錯:

TypeError: 1.0 has type numpy.float32, but expected one of: int
           

解決方法引用自:https://ask.csdn.net/questions/1231921

原因:onnx依賴protobuf,系統的protobuf版本太低引起。将protobuf版本3.0.0更新至3.7.1問題解決。

pip3 install -U protobuf