faster-rcnn.pytorch icon indicating copy to clipboard operation
faster-rcnn.pytorch copied to clipboard

I want to convert to onnx

Open velonica0 opened this issue 3 years ago • 4 comments

It has error: RuntimeError: Only tuples, lists and Variables are supported as JIT inputs/outputs. Dictionaries and strings are also accepted, but their usage is not recommended. Here, received an input of unsupported type: int Has anyone tried converting to onnx?

velonica0 avatar May 30 '22 12:05 velonica0

I trained the demo code and I got the .pth file. Now I wanna transform the .pth file to onnx by "torch.onnx.export" function, but got the error below.

TypeError: forward() missing 3 required positional arguments: 'im_info', 'gt_boxes', and 'num_boxes'

Did u ever met it? Or Do u know how to fix it? Thanks a lot!

caizhaoxin avatar Jun 23 '22 12:06 caizhaoxin

I didn't met ur error and I don't know why. Sorry.

caizhaoxin avatar Jun 23 '22 12:06 caizhaoxin

I solve this problem. ONNX need the input and output both the tensor, so you can transfer these. However, it will be another error: RuntimError: ONNX export failed: Could't export Python operator _ROIAlign If you can change, can you tell how to change faster-rcnn code? Thanks a lot.

velonica0 avatar Jun 25 '22 06:06 velonica0