tohinz / SVHN-Classifier

Simple classifier to classify SVHN images, based on Keras with the Tensorflow backend.
17 stars 4 forks source link

`steps=None` is only valid for a generator based on the `keras.utils.Sequence` class. Please specify `steps` or use the `keras.utils.Sequence` class. #2

Open bambrozio opened 5 years ago

bambrozio commented 5 years ago

Tried:

python svhn_classifier.py --predict --model weights.hdf5 --img_path ~/Downloads/tmp

and got:

(...)
Found 0 images belonging to 0 classes.
Traceback (most recent call last):
  File "svhn_classifier.py", line 174, in <module>
    predict(FLAGS.model, FLAGS.img_path, FLAGS.batch_size)
  File "svhn_classifier.py", line 159, in predict
    score = model.evaluate_generator(validation_generator)
  File "/Users/bambrozi/Downloads/SVHN-Classifier/env/lib/python3.7/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/Users/bambrozi/Downloads/SVHN-Classifier/env/lib/python3.7/site-packages/keras/engine/training.py", line 1472, in evaluate_generator
    verbose=verbose)
  File "/Users/bambrozi/Downloads/SVHN-Classifier/env/lib/python3.7/site-packages/keras/engine/training_generator.py", line 301, in evaluate_generator
    raise ValueError('`steps=None` is only valid for a generator'
ValueError: `steps=None` is only valid for a generator based on the `keras.utils.Sequence` class. Please specify `steps` or use the `keras.utils.Sequence` class.
jeroenboeye commented 5 years ago

Hi @bambrozio, Fix for me was to make sure the right version of keras is installed.

I used this requirements.txt file to ensure that:

tensorflow==1.13.1
keras==2.1.4
pillow==6.0.0
python-dateutil==2.8.0

Still dealing with other issues though 😅