hunglc007 / tensorflow-yolov4-tflite

YOLOv4, YOLOv4-tiny, YOLOv3, YOLOv3-tiny Implemented in Tensorflow 2.0, Android. Convert YOLO v4 .weights tensorflow, tensorrt and tflite
https://github.com/hunglc007/tensorflow-yolov4-tflite
MIT License
2.23k stars 1.24k forks source link

ValueError: Input 0 of node StatefulPartitionedCall/model/batch_normalization/AssignNewValue was passed float from Func/StatefulPartitionedCall/input/_4:0 incompatible with expected resource. #338

Open matthieu-as opened 3 years ago

matthieu-as commented 3 years ago

System information

When I try to convert my own trained yolov3-tiny model to tflite with the following command: _python convert_tflite.py --weights checkpoints/yolov3-tiny-416 --output yolov3.tflite --quantize_mode int8 --dataset cocodataset/coco/val207.txt , I always hit the fottlowing error: ValueError: Input 0 of node StatefulPartitionedCall/model/batch_normalization/AssignNewValue was passed float from Func/StatefulPartitionedCall/input/_4:0 incompatible with expected resource.

Did anyone run into the same error or knows how to solve it?

pramodhrachuri commented 3 years ago

I am also getting the same error. Were you able to solve it?

KulkarniKaustubh commented 3 years ago

Any luck with this issue? I am facing the same problem.

piggychu0w0 commented 3 years ago

I meet the same problem. Did any one solve it?

WZZDK commented 3 years ago

我也遇到这个问题,后面用tf2.3版本的重新运行了save_model.py再使用新生成的文件运行convert_tflite.py就没报错了。

JonathanSamelson commented 3 years ago

In case it helps, I also got this exact error using Linux with a Tensorflow container (2.3.0rc0). Both with convert_rt.py and convert_tflite.py However, I executed save_model.py on another machine and tried to convert this tensorflow model. Instead, I executed save_model.py in the container and it worked.

ddinhtuann commented 2 years ago

You should try to save_model tf again then convert to tflite. It worked for me. I hope it help you all.