Quick question #183
-
Hi, I'm trying to prefect my data and it's giving me an error: train_data AttributeError: 'DirectoryIterator' object has no attribute 'prefetch' Here's the link for my code: https://colab.research.google.com/drive/1iXMloev_OJ2GF_ot2oYosw7HWGGfuU_v?usp=sharing P.S. I know I don't need to prefetch this tiny dataset...and am just practicing with the concept of prefetching Thank you very much! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Hey @JoshK68, Use the So, replace your code :
with,
And also, you don't need to batch your data again here, as you've already mentioned the
And if your trying to unbatch the dataset imported by the above piece of code I suggested, use |
Beta Was this translation helpful? Give feedback.
-
One more quick question (I'm going through all my old notebooks and making sure reviewing all the mistakes, so sorry for so many questions these couple days!)... I know Daniel did a section on 'cross validation', but I looked everywhere multiple times. Thank you much! |
Beta Was this translation helpful? Give feedback.
-
Hey @JoshK68,
It's totally fine !! We all learn by asking, or at least that's how I learned. And about your question, It's strange, I didn't find it too. I guess in this course, Daniel had only explained the idea behind cross-validation, not the code part. I may be wrong, don't take my word 😂. However I'll let you know if I find it anywhere !! |
Beta Was this translation helpful? Give feedback.
-
Hi @gaurxvreddy, Thank you. Unfortunately that doesn't fix that prefetch error. When I fit it a few lines below (around line 100), then it gives this error: I checked Google and SO and still don't know how to fix this. Can you please advise? Thank you much! |
Beta Was this translation helpful? Give feedback.
Hey @JoshK68,
Use the
image_dataset_from_directory
function instead, it does the same job !!So, replace your code :