hhk7734 / tensorflow-yolov4

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

Custom model issue #18

Closed Cfor3 closed 4 years ago

Cfor3 commented 4 years ago

I was unable to use an already trained model due to this error:

ValueError: Model and weights file do not match.

Is it possible that it's because i used a modified config to train it? Is there already a possibility to solve this problem?

hhk7734 commented 4 years ago

is the config darknet config? Can you share your config file?

Cfor3 commented 4 years ago

Yes, the config file is of the darknet type.

yolov4-tiny-SLpred.zip

hhk7734 commented 4 years ago

Did you change the number of classes and the anchors?

Cfor3 commented 4 years ago

Below the parts that i edited

`subdivisions=16 width=832 height=832 ... burn_in=1000 max_batches = 7000 ... steps=5400,6200

filters=18 ... classes=1 ...`

I modified all the classes and filters above them, but not the anchors

hhk7734 commented 4 years ago

your anchors are 12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 459, 401 tiny's are 10,14, 23,27, 37,58, 81,82, 135,169, 344,319

https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov4-tiny.cfg

Cfor3 commented 4 years ago

My bad, i forgot to specify that i used the config file to detect small / large objects: https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov4-tiny-3l.cfg

Nonetheless, i also tried the version that you mentioned (with the same changes posted above) and gives me the same error.

hhk7734 commented 4 years ago

When I start this project, I didn't know there is such a config.

I only implemented the basic yolov4 and tiny. tiny-3l is not implemented.