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

Error converting ONNX to caffe2 #37

Open
rracinskij opened this issue Mar 4, 2019 · 1 comment
Open

Error converting ONNX to caffe2 #37

rracinskij opened this issue Mar 4, 2019 · 1 comment

Comments

@rracinskij
Copy link

rracinskij commented Mar 4, 2019

Hi,

the conversion of the model to caffe2 via ONNX does not work with Pytorch 1.0.1. The initial script converts the model to ONNX, but the conversion to caffe2 fails, as
init_net, predict_net = c2.onnx_graph_to_caffe2_net(model)
results in the Segmentation fault (core dumped) error.

I aslo tried to adapt a script from https://pytorch.org/tutorials/advanced/super_resolution_with_caffe2.html :

import onnx
import caffe2.python.onnx.backend as onnx_caffe2_backend
from caffe2.python.predictor import mobile_exporter

model = onnx.load('models/mb1-ssd.onnx')
prepared_backend = onnx_caffe2_backend.prepare(model)
c2_workspace = prepared_backend.workspace
c2_model = prepared_backend.predict_net
init_net, predict_net = mobile_exporter.Export(c2_workspace, c2_model, c2_model.external_input)

but it also fails:

...anaconda3/lib/python3.6/site-packages/caffe2/python/predictor/mobile_exporter.py", line 41, in add_tensor
    kTypeNameMapper[blob.dtype],
KeyError: dtype('float64')
@qfgaohao
Copy link
Owner

Caffe2 is harder to use in the latest versions. I will move it to pytorch1.0 c++ backend if i have time.

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

2 participants