-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error while exporting Detectron2 model to Onnx model #5210
Comments
You've chosen to report an unexpected problem or bug. Unless you already know the root cause of it, please include details about it by filling the issue template. |
@AakashGoyal25 trying changing your export-method from caffe2_tracing to tracing. |
@RajUpadhyay Even after changing export method to "tracing", I am getting same error mentioned above. Any other suggestion? |
@AakashGoyal25 Just for the peace of mind, can you replace output.yaml with normal mask_rcnn_R_50_FPN_3x.yaml or its faster_rcnn version. Also this is probably not the issue but Is your image path correct? There is a space |
As you mentioned I have replaced with COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml and took relative path to the sample image. Now I am getting: [02/20 09:54:22 detectron2]: Command line arguments: Namespace(format='onnx', export_method='caffe2_tracing', config_file='/home/aakash/Aakash_Workings/HB_Codes/detectron2_working/detectron2/configs/COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml', sample_image='d2_seal_control_ob_l/train/images/902f32eb-am_c1_20231005-104409.jpeg', run_eval=False, output='model.onnx', opts=['MODEL.DEVICE', 'cuda', 'MODEL.WEIGHTS', 'output/model_final.pth']) Traceback (most recent call last): |
@AakashGoyal25 |
Yes, it successfully export the onnx file. Thanks ! I can see some light 👍 But I am still not able to export it with my config.yaml.. Still facing the same issue mentioned in the first comment. I saved the config.yaml using the below code: Save the configurationcfg_yaml = cfg.dump() |
Maybe you could search a bit more on the internet regarding this. Can you try this way though |
@AakashGoyal25 have you been able to successfully export your Faster RCNN Model after all? |
@Huxwell..I was able to export it successfully to Onnx. But I didn't try to export to TensorRT. |
Thanks. I have realized, I am also able to export to onnx, only failing during onnx graphsurgeon for trt, so sorry for bothering you! |
I am trying to export my detectron2 model to onnx model but I am getting a KeyError: 'Non-existent config key: DATASETS.VAL'
Command I run:
Error Traceback:
config.yaml
In the config.yaml file, I can see that "val" is there still I am getting this issue. What am I doing wrong?
"Instructions To Reproduce the Issue and Full Logs":
config.yaml file is provided and It can be run using the above command.
Environment:
It is environemnt is setup using https://detectron2.readthedocs.io/en/latest/tutorials/install.html
The text was updated successfully, but these errors were encountered: