Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue May 12, 2019 · 1 comment

Comments

@bambrozio
Copy link

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
Copy link

jeroenboeye commented May 27, 2019

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 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants