Borda / keras-yolo3

A Keras implementation of YOLOv3 (Tensorflow backend) a successor of qqwweee/keras-yolo3
MIT License
31 stars 10 forks source link

Coustom Model and Coustom Classes #28

Closed Daniel-1597 closed 4 years ago

Daniel-1597 commented 4 years ago

This is the error I am facing while testing it on different weights and different anchors and different classes. How to resolve this issue? Screenshot from 2019-11-18 10-54-33

Borda commented 4 years ago

Hello, could you please copy-paste full error message (not an image) together with some description of your dataset and your usage (what script and parameters you used). Thx

Daniel-1597 commented 4 years ago

Sir, I am using Gaussian Yolo_V3 which uses bdd data set (https://github.com/jwchoi384/Gaussian_YOLOv3) The major issue while converting is that the model is different and the classes are different which are not matching

I tried to change the below line (in yolo.py line number 133) by adding + 12

out_shape = self.yolo_model.layers[-1].output_shape[-1]
            ration_anchors = num_anchors / len(self.yolo_model.output) * (num_classes + 5) + 12

so that out_shape matches when I did this I got the below error

Invalid ArgumentError(see above for trace back):

Input to reshape is a tensor with 14592 values, but the requested shape requires a multiple of 11520 [[ Node: Reshape_3 = Reshape[T =DT_FLOAT, Tshape =DT_INT32, _device="/job:localhost/replica :0/task:0/device :CPU:0"](conv2d_59/BiasAdd, Reshape_3/shape)]]

Number of Classes = 10 The cfg file for the gaussian Yolo and normal are different and classes as well which is creating the error

Borda commented 4 years ago

Hmmm, are you using /Gaussian YOLOv3 model or just their dataset? For nb of classes, you should not need to do any changes in code... you already have num_classes in the line you tried to edit...

Daniel-1597 commented 4 years ago

I am using their weights file and converting the weights to .h5

Borda commented 4 years ago

if you are using their weights, then I believe that it is not compatible and you should ask them... :)

Daniel-1597 commented 4 years ago

Ok thank you sir