Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to Convert resnet from Caffe to onnx and Pytorch #932

Open
payal211 opened this issue Feb 17, 2022 · 0 comments
Open

Fail to Convert resnet from Caffe to onnx and Pytorch #932

payal211 opened this issue Feb 17, 2022 · 0 comments

Comments

@payal211
Copy link

Hi,

I am getting below error while converting Resnet Model From caffe to onnx:

I0217 14:18:15.896023 8924 net.cpp:196] Top shape: 1 24 14 14 (4704)
I0217 14:18:15.896029 8924 layer_factory.hpp:77] Creating layer proposal
ImportError: No module named 'rpn'
Traceback (most recent call last):
File "/home/ubuntu/anaconda3/envs/python_3_5/bin/mmconvert", line 8, in
sys.exit(_main())
File "/home/ubuntu/anaconda3/envs/python_3_5/lib/python3.5/site-packages/mmdnn/conversion/_script/convert.py", line 102, in _main
ret = convertToIR._convert(ir_args)
File "/home/ubuntu/anaconda3/envs/python_3_5/lib/python3.5/site-packages/mmdnn/conversion/_script/convertToIR.py", line 16, in _convert
transformer = CaffeTransformer(args.network, args.weights, "tensorflow", inputshape[0], phase = args.caffePhase)
File "/home/ubuntu/anaconda3/envs/python_3_5/lib/python3.5/site-packages/mmdnn/conversion/caffe/transformer.py", line 325, in init
graph = GraphBuilder(def_path, self.input_shape, self.is_train_proto, phase).build()
File "/home/ubuntu/anaconda3/envs/python_3_5/lib/python3.5/site-packages/mmdnn/conversion/caffe/graph.py", line 454, in build
graph.compute_output_shapes(self.model)
File "/home/ubuntu/anaconda3/envs/python_3_5/lib/python3.5/site-packages/mmdnn/conversion/caffe/graph.py", line 263, in compute_output_shapes
net = caffe.Net(tmp_prototxt, caffe.TEST)
SystemError: <Boost.Python.function object at 0x2ccfd50> returned NULL without setting an error

Anyone can please help to figure it out?
Thank you.

Below are system Specifications and command I used to convert:
Platform (like ubuntu 16.04/win10): ubuntu 16.04

Python version: 3.5

Source framework with version (like Tensorflow 1.4.1 with GPU): CAFFE

Destination framework with version (like CNTK 2.3 with GPU): ONNX or PYTORCH

Running scripts: mmconvert --srcFramework caffe --inputWeight ./AMAR_MODELS/ctd_tloc_iter_91000_bkup_2_11_CW.caffemodel --inputNetwork ./AMAR_MODELS/test_ctd_tloc.prototxt --dstFramework onnx --outputModel ctd_tloc_iter_91000_bkup_2_11_CW.onnx --inputShape 1 3 224 224

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant