Skip to content
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

Converting to TFLite model fails #513

Open
aayushb-95 opened this issue Jun 25, 2024 · 3 comments
Open

Converting to TFLite model fails #513

aayushb-95 opened this issue Jun 25, 2024 · 3 comments

Comments

@aayushb-95
Copy link

aayushb-95 commented Jun 25, 2024

Hi,
I am trying to convert the Pytorch model to TFLite model. However I am getting the following error

TensorFlow SavedModel: export failure ❌ 13.7s: cannot import name 'C3' from 'models.common' 

TensorFlow Lite: starting export with tensorflow 2.16.1...
TensorFlow Lite: export failure ❌ 0.0s: 'NoneType' object has no attribute 'call'
Traceback (most recent call last):
  File "/home/aayush/yolov9/export.py", line 686, in <module>
    main(opt)
  File "/home/aayush/yolov9/export.py", line 681, in main
    run(**vars(opt))
  File "/home/aayush/miniconda3/envs/yolo9s/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/aayush/yolov9/export.py", line 611, in run
    add_tflite_metadata(f[8] or f[7], metadata, num_outputs=len(s_model.outputs))
                                                                ^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'outputs'

I tried the Useful Links section where I followed the link on how to convert to TFLite model. However, when i try to convert the TFLite model to a RKNN model format i get the following error which means the conversion tool is not able to read the input layers
AttributeError: 'NoneType' object has no attribute 'get_input_layers'
I would like to ask when will the export.py file support tflite format ?
Thanks in advance

@jifeng632
Copy link

same issue here

@jifeng632
Copy link

image

@burfom88
Copy link

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants