TNTWEN / OpenVINO-YOLOV4

This is implementation of YOLOv4,YOLOv4-relu,YOLOv4-tiny,YOLOv4-tiny-3l,Scaled-YOLOv4 and INT8 Quantization in OpenVINO2021.3
MIT License
238 stars 66 forks source link

ValueError: Dimension 1 in both shapes must be equal, but are 40 and 30. Shapes are [?,40,30] and [?,30,40] #7

Closed zgq91 closed 4 years ago

zgq91 commented 4 years ago

Hi: When the image width and height are not equal, for example 640*480 "ValueError: Dimension 1 in both shapes must be equal, but are 40 and 30. Shapes are [?,40,30] and [?,30,40]"

TNTWEN commented 4 years ago

Hi, @zgq91 I've reproduced this problem and I'll try to solve it.

TNTWEN commented 4 years ago

Hi, @zgq91 I have fixed it .Please git clone and try again. And let me know if it works! if you want to use 640*480 remember to change this line https://github.com/TNTWEN/OpenVINO-YOLOV4/blob/ab8b6454e3f59044095ba8914c5c36e09360ba08/convert_weights_pb.py#L38

to inputs = tf.placeholder(tf.float32, [None, 640, 480, 3], "inputs") Thanks for your trying!

zgq91 commented 4 years ago

change the yolo_v4.py file " if data_format == 'NCHW': new_height = out_shape[2] new_width = out_shape[3]

new_height = out_shape[3]

    #new_width = out_shape[2]
else:
    new_height = out_shape[1]
    new_width = out_shape[2]
    #new_height = out_shape[2]
    #new_width = out_shape[1]"  to work