isl-org / DPT

Dense Prediction Transformers
MIT License
1.96k stars 254 forks source link

.ONNX models #28

Open GeorgeAdamon opened 3 years ago

GeorgeAdamon commented 3 years ago

Hello,

are there any plans to provide the pre-trained models in .onnx format ?

Thank you!

ranftlr commented 3 years ago

Thanks for the request, we've noted it and plan to provide this eventually. It might take some time as the current implementation doesn't play well with jit/onnx exporters and it seems that we would need a partial rewrite of the model.

GeorgeAdamon commented 3 years ago

Thanks a lot @ranftlr , good to know. I had trouble trying to convert it using the common torch.onnx workflow.

Wing100 commented 2 years ago

Thanks a lot @ranftlr , good to know. I had trouble trying to convert it using the common torch.onnx workflow.

Hello,Has this problem been solved?

Wing100 commented 2 years ago

Thanks for the request, we've noted it and plan to provide this eventually. It might take some time as the current implementation doesn't play well with jit/onnx exporters and it seems that we would need a partial rewrite of the model.

Hello,I also encountered the same problem. Has this problem been solved, please?

romil611 commented 2 years ago

Hi @ranftlr , if you have suggestions regarding the required changes then please do tell. I wish to export it into an onnx file.

wtesler commented 2 years ago

Would also love to have them in onnx files

romil611 commented 2 years ago

I was able to do that by changing the unflatten function used in dpt/vit.py file to view.

wtesler commented 2 years ago

Hi @romil611 Are you saying that you successfully created an onnx file from this model? If so, is there a possibility to share it here? I would love to try it out and it's difficult for me to manually update the model.

romil611 commented 2 years ago

@wtesler I ran into some issues(#57 ) so I stopped using this model. Currently I don't have the files.