Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f065d37

Browse files
chinhuang007houseroad
authored andcommitted
Fix runtime error for onnx_graph_to_caffe2_net (#60)
Got 'The model does not have an ir_version set properly' exception when passing model.graph to onnx_graph_to_caffe2_net. The checker takes model parameter therefore pass model instead of graph.
1 parent 7b549ae commit f065d37

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tutorials/PytorchCaffe2MobileSqueezeNet.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@
258258
"# Export to mobile\n",
259259
"from caffe2.python.onnx.backend import Caffe2Backend as c2\n",
260260
"\n",
261-
"init_net, predict_net = c2.onnx_graph_to_caffe2_net(model.graph)\n",
261+
"init_net, predict_net = c2.onnx_graph_to_caffe2_net(model)\n",
262262
"with open(\"squeeze_init_net.pb\", \"wb\") as f:\n",
263263
" f.write(init_net.SerializeToString())\n",
264264
"with open(\"squeeze_predict_net.pb\", \"wb\") as f:\n",

0 commit comments

Comments
 (0)