I'm starting a ML project, and before I actually make a model I wanted to try to import my images (I have a file of just images I saved, they are .png if it matters) and play around with them and manipulate them so they will fit a model. All I do is load the files, and then try to show them, but it doesn't show anything. The file path seems to be right because the first time I tried it it was wrong and gave a big error message, but now doesn't seem to do so. How do I get it so when I load the files, I can run something like
data[0]
and see the first image (or details of the image). My code is as follows (I imported a lot of other things from the tensorflow guide above this code, so I don't think that's it, but I can edit in my other imports if that's necessary):
import pathlib
import sklearn.datasets
data_dir = sklearn.datasets.load_files('/Users/USer/Downloads/C4IMAGES/', shuffle='False')
data_dir
and the output of running this is:
{'data': [],
'filenames': array([], dtype=float64),
'target_names': [],
'target': array([], dtype=float64),
'DESCR': None}
and if I try data_dir[0] which should show the first image, the error message is
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-48-5541d6af8248> in <module>
2 import sklearn.datasets
3 data_dir = sklearn.datasets.load_files('/Users/USer/Downloads/C4IMAGES/', shuffle='False')
----> 4 data_dir[0]
KeyError: 0
Thanks for any help!