Keras-yolo3: During training: ValueError: Dimension 0 in both shapes must be equal, but are 1 and 255. Shapes are [1,1,1024,75] and [255,1024,1,1]. for 'Assign_360' (

Created on 27 Jun 2018  路  10Comments  路  Source: qqwweee/keras-yolo3

Hi,
During training, when yolo.py loads the weights, it throws the following error:

ValueError: Dimension 0 in both shapes must be equal, but are 1 and 255. Shapes are [1,1,1024,75] and [255,1024,1,1]. for 'Assign_360' (

Most helpful comment

I solved my problem by substituting the name of class in coco_classes.txt with my classes' name
and this txt is imported in yolo.py :"classes_path": 'model_data/coco_classes.txt',

All 10 comments

Hi:
I meet the same question, Help me.

the same problem, Help!

Any idea how to solve it?

Adding parameter by_name=True to load_weights solved my problem.

Hi,@parvathycec
I meet the same problem,do you addparameter like this: self.yolo_model.load_weights(self.model_path,by_name=True )

I just do it ,but it doesn't work.

Hi,@bayesianio @cnxhh @sinopec
I meet the same problem,have you fixed it?

I solved my problem by substituting the name of class in coco_classes.txt with my classes' name
and this txt is imported in yolo.py :"classes_path": 'model_data/coco_classes.txt',

i can't get what you mean clearly. can you explain more details or answer in Chinese?@louxy126

Yea so this is a problem with the classes file, model file and/or anchor file not matching. Make sure that the same classes.txt file (the file where per new line your classes are defined) matches during training and during inference (test). In my case I used 2 different classes.txt file. One file had 4 categories and the other one had only 1 class.

i have already solved this problem in this method. i used the wrong class file. Thanks a lot!!!

Was this page helpful?
0 / 5 - 0 ratings