ValueError: `validation_steps=None` is only valid for a generator based on the `keras.utils.Sequence` class. Please specify `validation_steps` or use the `keras.utils.Sequence` class.
See original GitHub issueValueError Traceback (most recent call last) <ipython-input-22-9e051c003cc7> in <module>() 10 validation_data=val_generator, 11 validation_steps=ceil(val_dataset_size/batch_size), —> 12 initial_epoch=initial_epoch)
~/anaconda2/envs/py3/lib/python3.5/site-packages/keras/legacy/interfaces.py in wrapper(*args, **kwargs)
89 warnings.warn('Update your ' + object_name + 90 '
call to the Keras 2 API: ’ + signature, stacklevel=2)
—> 91 return func(*args, **kwargs)
92 wrapper._original_function = func
93 return wrapper
~/anaconda2/envs/py3/lib/python3.5/site-packages/keras/engine/training.py in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
2105 if (val_gen and not isinstance(validation_data, Sequence) and
2106 not validation_steps):
-> 2107 raise ValueError(‘validation_steps=None
is only valid for a’
2108 ’ generator based on the keras.utils.Sequence
’
2109 ’ class. Please specify validation_steps
or use’
ValueError: validation_steps=None
is only valid for a generator based on the keras.utils.Sequence
class. Please specify validation_steps
or use the keras.utils.Sequence
class.
I found an error using ssd-training,thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (1 by maintainers)
Top GitHub Comments
Hi,
I had the same error. My validation_steps were set to:
validation_steps=nb_validation_samples // batch_size
Turns out mynb_validation_samples
were less thanbatch_size
I had the same error, and I came out of this after modified the validation_steps. Maybe it cannot be too low.