-1

I'm fairly new to machine learning and I've to create a image classification model using tensorFlow, but I'm having hard time loading the images datasets. I get the error 'str' object has no attribute 'load_data', and I'm not sure what it means. This is what I've for loading the image data: enter image description here

Is this the correct way to load a custom data? Also, my script is in the same folder as the Product folder that has the sub-folders for different categories.

Isha
  • 138
  • 1
  • 10

1 Answers1

0

Yeah, of course - as you can see, data variable is just a string. To get data you have to import or create dataset. Here you can find a good example for image classification and how to import a dataset - LINK

  • Thank you for letting me know, but I want to load my custom dataset not a pre-trained dataset, like instead of datasets.cifar10, I want to load my own dataset. I'm really confused on how to do that. – Isha Mar 03 '21 at 13:51
  • Ok, but you have to create a dataset first - for example load from csv file or get data from database or just simply create a data structure. Your code (posted above) is just declare a string variable. – Martin Domino Mar 03 '21 at 13:57
  • Okay, how can I covert the image data in the form of a csv file? – Isha Mar 03 '21 at 14:00
  • Maybe try something like this https://medium.com/analytics-vidhya/create-your-own-real-image-dataset-with-python-deep-learning-b2576b63da1e – Martin Domino Mar 03 '21 at 14:01
  • Okay, I tried that just now and I keep on getting this error !_src.empty() in function 'cvtColor', do you what it might entail ? Thank you so much for you help tho! – Isha Mar 03 '21 at 14:09
  • It may be a lot of reasons, but I think that you have to be sure, that image has been loaded succesfully. (you can try to load simple image (not in for loop and print it - pic variable in this tutorial). – Martin Domino Mar 03 '21 at 14:21
  • I got that to work now, thank you so much for you help. I've now created the data frame is that used for creating csv files, right? – Isha Mar 03 '21 at 14:38
  • Yeah, but storing images in dataframes and csv files might by not efficient. You can just save a numpy arrays on your local diskspace – Martin Domino Mar 03 '21 at 14:59