tensorflow-yolov4-tflite icon indicating copy to clipboard operation
tensorflow-yolov4-tflite copied to clipboard

ValueError: cannot reshape array of size 588196 into shape (512,256,3,3)

Open KuoEuran opened this issue 4 years ago • 4 comments

I want to convert my darknet weights to tensorflow. when I use the command : python save_model.py --weights ./data/yolov4-tier_last.weights --output ./checkpoints/yolov4-320 --input_size 320 --model yolov4 And I get the error image And I have changed the input size of picture to 320 in convert_tflite.py. But it still shows that shape 512x256x3x3. And I have changed the coco.names to one class(person) according to some solutions but it doesn't work. image Isn't there anything I miss, please let me know

KuoEuran avatar May 28 '21 05:05 KuoEuran

到core資料夾 -> config.py -> __C.YOLO.CLASSES 換成你的obj.names

chun-ming-Lin avatar Aug 12 '21 13:08 chun-ming-Lin

This type of shape error occurs when you try to convert the yolov4 version other than the default i.e. on the AlexAB repository. It causes a mismatch in weights and the TensorFlow model written in this repo. So try to custom train (or use the default) weights according to AlexAB repository... Don't modify the model or you have to make the same modifications in the TensorFlow model in this repository....

immuhammadadil avatar Oct 31 '21 15:10 immuhammadadil

@immuhammadadil any idea of how to convert a darknet model to tflite after we change its structure, using this repository. Is it possible? I have the new .weights and .cfg file Thanks

Abhishek672 avatar Feb 15 '22 06:02 Abhishek672

@immuhammadadil Hi, Did you have any idea about the issue :https://github.com/hunglc007/tensorflow-yolov4-tflite/issues/422? I have stuck by conversion of separable depthwise convoution. If you have any ideas, please give me some advice, tks.

KuoEuran avatar Feb 16 '22 06:02 KuoEuran