Deci-AI / super-gradients

Easily train or fine-tune SOTA computer vision models with one open source training library. The home of Yolo-NAS.
https://www.supergradients.com
Apache License 2.0
4.53k stars 492 forks source link

how to convert .pth model into .h5 format? or how can we use .pth weight as api #533

Closed akashAD98 closed 1 year ago

akashAD98 commented 1 year ago

how can we use .pth or .onnx weight ,there inference & want to use this weight in flask,gradio, etc apps

dagshub[bot] commented 1 year ago

Join the discussion on DagsHub!

lkdci commented 1 year ago

Hi @akashAD98 , converting pytorch models to keras isn't such a trivial thing to do. I can recommend a really nice repo https://github.com/MPolaris/onnx2tflite which convert an ONNX model to keras h5 model and tflite model. This repo handle this the best among other repos as far as I know. According to their doc you can see that most of the common classification models are supported and tested, but this tool is still experimental and some segmentation / detection models might not be convert well and might result with discrepancy in output tensors.