hhk7734 / tensorflow-yolov4

YOLOv4 Implemented in Tensorflow 2.
MIT License
136 stars 75 forks source link

ValueError: Model and weights file do not match. #7

Closed Twinkle126 closed 4 years ago

Twinkle126 commented 4 years ago

Hi,

I have trained a custom dataset with YOLOv4. Now I am trying to use the trained model on test image but I am getting following error- tf2error

My env is as below- Python 3.7.6 TensorFlow 2.0.0 Windows 10

Please suggest.

hhk7734 commented 4 years ago

Can you share convert.py?

Twinkle126 commented 4 years ago

This is my file- convert.txt

hhk7734 commented 4 years ago

It seems that the numbers of classes in yolo-obj_best.weights and in obj.names do not match.

Twinkle126 commented 4 years ago

But I have tested the new images with Darknet command using same weights file and it works well.

hhk7734 commented 4 years ago

Can you share xx.cfg used to train? and obj.names.

Twinkle126 commented 4 years ago

yolo-obj.txt

obj_names.txt

hhk7734 commented 4 years ago

hmm.. It seems no problem. I don't know why.

To create the same problem, I trained pothole(1 class) images using darknet yolov4. hole.weights file size is 256.0 MB (256,015,980 bytes). It runs successfully