How do you recreate a ImageDataBunch?

At the end of the “Cleaning up” section of the tutorial on how to create your own image data set, it says to " Remember to recreate your ImageDataBunch from your cleaned.csv to include the changes you made in your data!". How does one do that exactly?

1 Like

as I saw in another post, I used:
db=ImageDataBunch.from_csv(‘data/cars’,csv_labels=‘cleaned.csv’,label_col=1,valid_pct=0.2,ds_tfms=get_transforms(), size=224, num_workers=0).normalize(imagenet_stats)

Thank you. But when I tried running that I got this error:
SyntaxError: invalid character in identifier
Any idea why that might be? I also would love to know exactly what the code is doing. I understand the way this course is supposed to work is that you’re not supposed to understand everything right away, and I’m OK with that. But sometimes I’m worried whether there’s too much that I’m not understanding. Do you have any insight as to whether this is something that I should understand already? Thank you so much for your help!

can you copy all the lines off code and error? yeah sometimes I feel kind a angustious about these things of “don’t worry about what it means, just accept this code and soon you going to understand” haha, but talking about the function I understood that ‘data/cars’ is the file path, csv_labels references the file name, label_col=1 means the first column of the csv file is going to be used as labels, valid_pct = 0.2 means that 20% of the databunch is going to be used for validation ( the other 80% is the dataset used to train the model), about the rest of the code I really don’t know what it means. if you discover I will appreciate it,
Thanks

I realized that the notebook I was working on is for the lesson 2 video, not the lesson 1 video. So I’m going to try to go through the lesson 2 video and start again from scratch and will let you know if I run into the same problem and/or I gain anymore insight on the code your provided or anything else. Thank you for all your help!