I'm trying to run the code from this tutorial. I have placed the code and dataset in the same directory, but still I get the following error.
FileNotFoundError Traceback (most recent call last)
<ipython-input-6-5f5284db0527> in <module>()
39 # extract features from all images
40 directory = 'Flicker8k'
---> 41 features = extract_features(directory)
42 print('Extracted Features: %d' % len(features))
43 # save to file
<ipython-input-6-5f5284db0527> in extract_features(directory)
18 # extract features from each photo
19 features = dict()
---> 20 for name in listdir(directory):
21 # load an image from file
22 filename = directory + '/' + name
**FileNotFoundError: [WinError 3] The system cannot find the path specified: 'Flicker8k'**
The system cannot find the path specified: 'Flicker8k'
It complains about not being able to find specified directory. Try to replace relative directory path directory = 'Flicker8k'
with full absolute path to the Flicker8k
directory (seems like you are on Windows so something that looks like C:\myproject\Flicker8k
or if you are on linux /home/user/myproject/Flicker8k
or wherever that dataset resides). So, make sure to:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With