linghu8812 / tensorrt_inference

702 stars 206 forks source link

ONNX export failure: ONNX export failed: Couldn't export Python operator MishCudaFunction #13

Open xuanzhangyang opened 3 years ago

xuanzhangyang commented 3 years ago

ONNX export failure: ONNX export failed: Couldn't export Python operator MishCudaFunction

linghu8812 commented 3 years ago

Has the mish cuda function been installed following the instruction: https://github.com/WongKinYiu/ScaledYOLOv4/blob/yolov4-large/README.md#installation?

xuanzhangyang commented 3 years ago

Has the mish cuda function been installed following the instruction: https://github.com/WongKinYiu/ScaledYOLOv4/blob/yolov4-large/README.md#installation?

Yes, I can successfully inference yolov4-p6 model with https://github.com/WongKinYiu/ScaledYOLOv4/blob/yolov4-large engine.

linghu8812 commented 3 years ago

for pretrained models, these lines will work: https://github.com/linghu8812/tensorrt_inference/blob/887cca1487395cc46a23537213201d224600a976/ScaledYOLOv4/export_onnx.py#L28-L41

xuanzhangyang commented 3 years ago

for pretrained models, these lines will work: https://github.com/linghu8812/tensorrt_inference/blob/887cca1487395cc46a23537213201d224600a976/ScaledYOLOv4/export_onnx.py#L28-L41

The problem is solved. # modify import in models/common.py # line 7 -> from mc.build.lib.mish_mish import MishCuda as Mish

The above steps are missing, but I don’t know why I can inference model.

pepijnko commented 3 years ago

@xuanzhangyang I have the same problem, to what should i edit the line 7 ?

Thank you in advance