Open minhhoangbui opened 3 years ago
Thank you very much for your materials. I managed to use your pytorch dcn to train my model. However, when I convert this model to ONNX format, this error apprears. Do you know why?
File "/data1/hoangbm/codes/CenterNet/src/lib/models/networks/dcnv2_torch15/dcn_v2_wrapper.py", line 105, in forward return DeformableConv2DFunction.apply(inputs, self.weight, self.bias, offset, mask, self.stride, self.pad, self.dilation, self.deformable_groups) File "/data1/hoangbm/codes/CenterNet/src/lib/models/networks/dcnv2_torch15/dcn_v2_wrapper.py", line 28, in forward ctx.deformable_groups IndexError: _Map_base::at
This code produce this error
onnx.export(model, input_, '/data1/hoangbm/temp/pp_cnet15_dla.onnx', keep_initializers_as_inputs=True, verbose=False, operator_export_type=OperatorExportTypes.ONNX)
I never used onnx to run models before, but as I as I know, if you want to use informal layers in onnx, you also need to write plugins like what i did to pytorch and tensorrt...
@SsisyphusTao , Could you explain how to implement the code of custom op in ONNX .
As far as i am concerned, it just need to register the simbolic function through g.op()
after we can use the register op in pytorch. I think there are there steps for custom ops:
Thank you very much for your materials. I managed to use your pytorch dcn to train my model. However, when I convert this model to ONNX format, this error apprears. Do you know why?
This code produce this error