angulartist / Keras-HDF5-ImageDataGenerator

Blazing fast HDF5 Image Generator for Keras :zap:
https://pypi.org/project/h5imagegenerator/
BSD 3-Clause "New" or "Revised" License
13 stars 4 forks source link

Error: have shape (10,) but got array with shape (9,) #1

Closed cubecloud closed 4 years ago

cubecloud commented 4 years ago

Hi!

I have this error at begining of 3rd epoch, with testing your hdf5-imageDataGenerator in Colab. Testing was with mnist dataset. If you wanna i can send a screenshot and .ipynb file.

ValueError: Error when checking target: expected dense_6 to have shape (10,) but got array with shape (9,)

angulartist commented 4 years ago

Hello, in case you're using one hot encoding, you have to tell your generator the number of classes using the num_classes parameter (num_classes=10).

Also, sorry for this, I was a bit busy these days, going back to work on it;)

cubecloud commented 4 years ago

Thank you for prompt reply! I'm added in generator, "num_classes=10," - it's working. Unfortunatelly, i have only 1 problem, after testing, on mnist dataset - speed (w/o augmenting). I'm wana try to create datagen w/o HDF5matrix, but with hdf5 and slices, where is the slice = chunk size. The max chunk is 4gb, its enough for getting at least 2 chunks to GPU memory. The main idea is create fast datagen for huge amount of data.