detectron2 plus PyTorch plus ONNX

Created on 9 Jan 2020  路  2Comments  路  Source: facebookresearch/detectron2

Hello,

From issues such that https://github.com/facebookresearch/detectron2/issues/657 I've learned that it is needed to use pytorch built from source to test new caffe2 exporting feature.

But due to this bug https://github.com/onnx/onnx/issues/2417 it is impossible to run detectron2.export.api.export_caffe2_model using pytorch==1.5.0a0+0dbd5c0 and onnx==1.6.0.
Assuming that onnx==1.6.0 is buggy I've tried to use onnx==1.5.0 but it is incompatible with pytorch==1.5.0a0

So all attempts end up with

~/anaconda2/envs/pytorch-master/lib/python3.7/site-packages/caffe2/python/onnx/backend.py in onnx_graph_to_caffe2_net(cls, model, device, opset_version)
    919     @classmethod
    920     def onnx_graph_to_caffe2_net(cls, model, device="CPU", opset_version=_known_opset_version):
--> 921         return cls._onnx_model_to_caffe2_net(model, device=device, opset_version=opset_version, include_initializers=True)
    922 
    923     @classmethod

~/anaconda2/envs/pytorch-master/lib/python3.7/site-packages/caffe2/python/onnx/backend.py in _onnx_model_to_caffe2_net(cls, onnx_model, device, opset_version, include_initializers)
    874         device_option = get_device_option(Device(device))
    875 
--> 876         onnx_model = onnx.utils.polish_model(onnx_model)
    877         init_model = cls.optimize_onnx(onnx_model, init=True)
    878         pred_model = cls.optimize_onnx(onnx_model, predict=True)

~/anaconda2/envs/pytorch-master/lib/python3.7/site-packages/onnx/utils.py in polish_model(model)
     19     onnx.helper.strip_doc_string(model)
     20     model = onnx.shape_inference.infer_shapes(model)
---> 21     model = onnx.optimizer.optimize(model)
     22     onnx.checker.check_model(model)
     23     return model

~/anaconda2/envs/pytorch-master/lib/python3.7/site-packages/onnx/optimizer.py in optimize(model, passes, fixed_point)
     53         optimized_model_str = C.optimize_fixedpoint(model_str, passes)
     54     else:
---> 55         optimized_model_str = C.optimize(model_str, passes)
     56 
     57     return onnx.load_from_string(optimized_model_str)

IndexError: _Map_base::at

Is there a combination of installed libraries versions to test the new functionality?

Most helpful comment

All 2 comments

The feature is not yet ready due to the dependencies like pytorch and onnx. Please wait until there are instructions on how to use it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

choasup picture choasup  路  3Comments

ChungNPH picture ChungNPH  路  3Comments

danielgordon10 picture danielgordon10  路  3Comments

kl720 picture kl720  路  3Comments

Cold-Winter picture Cold-Winter  路  3Comments