If you are using Tensorflow 1.14.0 and ImageDataGenerator, then when fitting the generator to the model, this error appears: ```python AttributeError: 'DirectoryIterator' object has no attribute 'shape' ``` # FIX Enter ```bash nano ~/.local/lib/python3.6/site-packages/tensorflow/python/keras/engine/training_generator.py ``` into the terminal and edit the problem line. From: ```python # 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: ```python 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) ```
author | octav |
---|---|
permlink | tensorflow-imagedatagenerator-directoryiterator-object-has-no-attribute-shape |
category | python |
json_metadata | {"tags":["python","tensorflow","ai","machinelearning","howtofix"],"app":"steemit/0.1","format":"markdown"} |
created | 2019-08-18 10:16:45 |
last_update | 2019-08-18 10:20:57 |
depth | 0 |
children | 1 |
last_payout | 2019-08-25 10:16:45 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 937 |
author_reputation | 647,853,339,261 |
root_title | "Tensorflow ImageDataGenerator 'DirectoryIterator' object has no attribute 'shape'" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,660,515 |
net_rshares | 20,169,986,179 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
steemitboard | 0 | 15,776,662,032 | 1% | ||
ratticus | 0 | 4,393,324,147 | 10% |
Congratulations @octav! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) : <table><tr><td><img src="https://steemitimages.com/60x70/http://steemitboard.com/@octav/posts.png?201908181223"></td><td>You published more than 50 posts. Your next target is to reach 60 posts.</td></tr> </table> <sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@octav) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=octav)_</sub> <sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub> To support your work, I also upvoted your post! ###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!
author | steemitboard |
---|---|
permlink | steemitboard-notify-octav-20190818t125105000z |
category | python |
json_metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
created | 2019-08-18 12:51:03 |
last_update | 2019-08-18 12:51:03 |
depth | 1 |
children | 0 |
last_payout | 2019-08-25 12:51:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 875 |
author_reputation | 38,975,615,169,260 |
root_title | "Tensorflow ImageDataGenerator 'DirectoryIterator' object has no attribute 'shape'" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,664,154 |
net_rshares | 0 |