Open computerVision3 opened 2 months ago
@computerVision3 it seems you're encountering issues with exporting to TensorFlow formats. Please ensure you're using the latest YOLOv5 version and verify your custom model configuration aligns with the export requirements. If the issue persists, consider simplifying your model or checking for any recent updates or fixes in the repository. For further guidance, refer to the YOLOv5 export documentation.
Search before asking
Question
I encountered errors while attempting to export a YOLOv5 model to TensorFlow SavedModel and TFLite formats. The model is a YOLOv5 with FPN, and the export process fails with the following errors:
TensorFlow SavedModel: export failure β 1.5s: TFDetect.__init__() got multiple values for argument 'w'
TensorFlow Lite: export failure β 0.0s: 'NoneType' object has no attribute 'call' Traceback (most recent call last): File "/home/ai/Masood/Pipes/yolov5_old/export.py", line 1542, in <module> main(opt) File "/home/ai/Masood/Pipes/yolov5_old/export.py", line 1537, in main run(**vars(opt)) File "/home/ai/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) File "/home/ai/Masood/Pipes/yolov5_old/export.py", line 1450, in run add_tflite_metadata(f[8] or f[7], metadata, num_outputs=len(s_model.outputs)) AttributeError: 'NoneType' object has no attribute 'outputs'
Additional
yolov5fpn.yaml
nc: 80 # number of classes depth_multiple: 1.0 # model depth multiple width_multiple: 1.0 # layer channel multiple anchors:
YOLOv5 v6.0 backbone
backbone: [ [-1, 1, Conv, [64, 6, 2, 2]], # 0-P1/2 [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 [-1, 3, C3, [128]], [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 [-1, 6, C3, [256]], [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 [-1, 9, C3, [512]], [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 [-1, 3, C3, [1024]], [-1, 1, SPPF, [1024, 5]], # 9 ]
YOLOv5 v6.0 FPN head
head: [ [-1, 3, C3, [1024, False]], # 10 (P5/32-large)
]