PINTO0309 / PINTO_model_zoo

A repository for storing models that have been inter-converted between various frameworks. Supported frameworks are TensorFlow, PyTorch, ONNX, OpenVINO, TFJS, TFTRT, TensorFlowLite (Float32/16/INT8), EdgeTPU, CoreML.
https://qiita.com/PINTO
MIT License
3.49k stars 566 forks source link

The TensorFlow models download by download_iter02_tensorrt.sh are actually ONNX models #351

Closed daviszhu88 closed 1 year ago

daviszhu88 commented 1 year ago

Issue Type

Bug

OS

Windows

OS architecture

x86_64

Programming Language

C++

Framework

TensorFlow

Model name and Weights/Checkpoints URL

https://github.com/PINTO0309/PINTO_model_zoo/tree/main/284_CREStereo

Description

The model files are actually ONNX files. Could you have it fixed as soon as possible? Thanks and I really appreciate it.

Relevant Log Output

No response

URL or source code for simple inference testing code

No response

PINTO0309 commented 1 year ago
onnx2tf -i xxxx.onnx -osd -cotof
daviszhu88 commented 1 year ago

Thanks for your quick response. I tried to use your tool to do the conversion but had problems (see the below). Does the tool require Python 3.10? I have Python 3.11. I am retrying with the command you provided.

(CREStereo_ONNX) C:\Hongwei\DeepLearning\onnx2tf>onnx2tf -i crestereo_init_iter20_720x1280.onnx

File "C:\Users\davis\AppData\Roaming\Python\Python311\site-packages\tensorflow\python\framework\importer.py", line 515, in _import_graph_def_internal

raise ValueError(str(e))

ValueError: Invalid GraphDef

Also, I noticed that the ONNX files have different names. Do you convert the MegEgnine model to ONNX, or convert from the PyTorch model to ONNX? How can I specify the iteration number and image size during the conversion?

Still, if you do have the TensorFlow models already converted, it might be more convenient for me to just get the models from you, just like the ONNX files.

Do you ever tried to use those models in C++?

Thanks and I really appreciate your time and kind help.

Hongwei

ESRI (www.esri.com), California, USA

On Tue, Jul 25, 2023 at 4:35 PM Katsuya Hyodo @.***> wrote:

onnx2tf -i xxxx.onnx -osd -cotof

— Reply to this email directly, view it on GitHub https://github.com/PINTO0309/PINTO_model_zoo/issues/351#issuecomment-1650706053, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS6UABLUX3PIKAWZ6QOBKDTXSBJ4JANCNFSM6AAAAAA2XRGMP4 . You are receiving this because you authored the thread.Message ID: @.***>

daviszhu88 commented 1 year ago

onnx2tf -i xxxx.onnx -osd -cotof

Took very long time (>1 hour) and get an error:

(CREStereo_ONNX) C:\Hongwei\DeepLearning\onnx2tf>onnx2tf -i crestereo_init_iter20_720x1280.onnx -osd -cotof

File "C:\Users\davis\AppData\Roaming\Python\Python311\site-packages\tensorflow\python\framework\importer.py", line 515, in _import_graph_def_internal raise ValueError(str(e)) ValueError: Invalid GraphDef