I am working on Image captioning, and I found this great tutorial for MS-COCO challenge. MS_COCO Image captioning demo
Anyway, I ran the demo and everything went well. Except, when I try to change the sample image (I want to run another images), I get this error:
KeyError Traceback (most recent call last)
<ipython-input-126-68bce2986aae> in <module>()
1 # load and display image
----> 2 I = io.imread('%s/images/%s/%s'%(dataDir,dataType,img['000000014226.jpg']))
3
4 plt.axis('off')
5 plt.imshow(I)
KeyError: '000000014226.jpg'
I know that the code responsible for this error is this:
# load and display image
I = io.imread('%s/images/%s/%s'%(dataDir,dataType,img['000000014226.jpg']))
# use url to load image
# I = io.imread(img['coco_url']) # originally they used to run this
plt.axis('off')
plt.imshow(I)
plt.show()
I made sure that I am in the directory of val2017. So what is the issue here? Any ideas. Many thanks!