experiencor / keras-yolo2

Easy training on custom dataset. Various backends (MobileNet and SqueezeNet) supported. A YOLO demo to detect raccoon run entirely in brower is accessible at https://git.io/vF7vI (not on Windows).
MIT License
1.73k stars 785 forks source link

Improper image size? #330

Open cmeff1 opened 6 years ago

cmeff1 commented 6 years ago

Went thru labeling images and generating necessary files and when I go to train I receive this error message: "tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimension size must be evenly divisible by 2 but is 9 for 'lambda_1/SpaceToDepth' (op: 'SpaceToDepth') with input shapes: [?,9,9,64]" which I'm speculating is related to my images that I'm using for training, but I'm not 100% sure and was wondering if anybody had any suggestions. Thank you.

cmeff1 commented 6 years ago

After some further poking, I see that the size of the images is put into the config.json I believe? Should we be preprocessing these images before attempting to train on them? (resizing etc)

rodrigo2019 commented 6 years ago

No, the batch generator will do this pre processing. Which values did you put in json file?

mugeshuzi commented 6 years ago

I try to modify the value of input_size in the json file according to my data and get the same error as yours, which I think is because the network is not supported for multiple input size or any other suggestion?

rodrigo2019 commented 6 years ago

@mugeshuzi it supports, all images with different sizes will be rized to the value set in json file .

which value are you putting? could you print your terminal message when you try to start a training?

zhiyilearn commented 5 years ago

I have same problem, input_size in config.json I put 416. My image size is 1250 x 720.