Vehicle-CV-ADAS icon indicating copy to clipboard operation
Vehicle-CV-ADAS copied to clipboard

convertPytorchToONNX.py

Open Minnchong opened this issue 1 year ago • 3 comments

I successfully converted the curvelanes/tusimple.pth into curvelanes/tusimple.onnx. When I try to achieve culane.onnx, the process was killed at torch.onnx.export(net, img, onnx_file_path, verbose=True).

Minnchong avatar Mar 30 '23 06:03 Minnchong

I haven't encountered this issue before, could you provide me with the error traceback? Also, if you want better performance, I suggest using the ultra-fast lane detection v2 version would be better.

jason-li-831202 avatar Mar 30 '23 09:03 jason-li-831202

I also encountered a similar problem where the operation was terminated abnormally

C:\Users\86152\anaconda3\envs\lane-det\python.exe C:/Users/86152/Desktop/AI/code/Vehicle-CV-ADAS-master/TrafficLaneDetector/convertPytorchToONNX.py Model Type : UFLDV2_TUSIMPLE C:\Users\86152\anaconda3\envs\lane-det\lib\site-packages\torchvision\models_utils.py:209: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead. f"The parameter '{pretrained_param}' is deprecated since 0.13 and may be removed in the future, " C:\Users\86152\anaconda3\envs\lane-det\lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=ResNet18_Weights.IMAGENET1K_V1. You can also use weights=ResNet18_Weights.DEFAULT to get the most up-to-date weights. warnings.warn(msg)

Process finished with exit code -1073741819 (0xC0000005)

Jilin-Cancer avatar Nov 28 '23 15:11 Jilin-Cancer

In torchvision 0.13, there were updates to the pre-trained model loading. I believe there might be compatibility issues with the provided .pth files by the original author.

you can download the onnx model using the following script: https://github.com/PINTO0309/PINTO_model_zoo/blob/main/324_Ultra-Fast-Lane-Detection-v2/download.sh.

jason-li-831202 avatar Nov 29 '23 03:11 jason-li-831202