qqwweee / keras-yolo3

A Keras implementation of YOLOv3 (Tensorflow backend)
MIT License
7.14k stars 3.45k forks source link

errore in train.py ""Dimension 0 in both shapes must be equal . "" #162

Open web333 opened 6 years ago

web333 commented 6 years ago

i have got a problem in debug code train.py

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

i try to train in voc-2007

my code is: ` annotation_path = '2007_train.txt' log_dir = 'logs/000/' classes_path = 'model_data/voc_classes.txt' anchors_path = 'model_data/yolo_anchors.txt' class_names = get_classes(classes_path) num_classes = len(class_names) anchors = get_anchors(anchors_path)

input_shape = (416,416) # multiple of 32, hw

is_tiny_version = len(anchors)==6 # default setting

if is_tiny_version:
    model = create_tiny_model(input_shape, anchors, num_classes,
        freeze_body=2, weights_path='model_data/tiny_yolo_weights.h5')
else:
    model = create_model(input_shape, anchors, num_classes,
        freeze_body=2, weights_path='model_data/yolo_weights.h5') # make sure you know what you freeze
`

can you help me to slove this problem? tnx

MichalDulemba commented 6 years ago

I have similar issue. Have you somehow fixed that?

boyliwensheng commented 6 years ago

i also has this problem too. Do you sovle it?

louxy126 commented 6 years ago

Hi,@web333 @MichalDulemba @b02902131 I met the same problem when i python yolo_vedio.py ,have you fixed it?

louxy126 commented 6 years ago

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',