Published: 18 Aug 2019 › Updated: 18 Aug 2019
Tensorflow ImageDataGenerator 'DirectoryIterator' object has no attribute 'shape'
If you are using Tensorflow 1.14.0 and ImageDataGenerator, then when fitting the generator to the model, this error appears:
AttributeError: 'DirectoryIterator' object has no attribute 'shape'
FIX
Enter
nano ~/.local/lib/python3.6/site-packages/tensorflow/python/keras/engine/training_generator.py
into the terminal and edit the problem line.
From:
# Convert to a format that supports `next(generator)`.
generator, steps_per_epoch = convert_to_generator_like(
data,
steps_per_epoch=steps_per_epoch,
batch_size=batch_size,
epochs=epochs - initial_epoch,
shuffle=shuffle)
To:
generator = data
# Convert to a format that supports `next(generator)`.
# generator, steps_per_epoch = convert_to_generator_like(
# data,
# steps_per_epoch=steps_per_epoch,
# batch_size=batch_size,
# epochs=epochs - initial_epoch,
# shuffle=shuffle)
Leave Tensorflow ImageDataGenerator 'DirectoryIterator' object has no attribute 'shape' to:
Read more #python posts
Best Posts From Octav
We have not curated any of octav's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Octav
- luarocks install loadcaffe: Error: No results matching query were found
- Tensorflow ImageDataGenerator 'DirectoryIterator' object has no attribute 'shape'
- How2: Swift 4 TF
- Etherum mining in Genesis - Review/Experience - Part IV - Last
- Merge 2 directories in python
- ssh not working/Connection refused on OrangePi/Debian
- California pepper origin Turkey & origin Spain & made in Romania
- Corporate
- Bugfixing before the release
- Bitcoin curve through a sound synth
- [Sherlock] Find the squirrel for 1 SBD
- When you get paid by Google to use their free trial
- Revolut is not encrypting its data!
- Revolut is not encrypting its data!
- When the wife gets home, but the husband is nowhere to be found
- Pokemon went
- Youtube autoplay fail
- Explaining steem
- Polysolar. George Iacobescu. Canary Wharf
- A successful trap