-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when processing training images #4
Comments
thank you posting an issue. poof! I'm not quite sure what's up here. One strategy to follow here is to print the filenames as they are being processed, and then manually look at the filename that failed. Presumably there is something wrong with its encoding. Could you report what the filename is? And can you try opening it in some image editing program, saving it back to a jpg, replacing the original, and rerunning? |
Okay, I'm going to rerun the script now with the following change in place: diff --git a/prepro.py b/prepro.py
index ea581da..7440963 100644
--- a/prepro.py
+++ b/prepro.py
@@ -183,7 +183,11 @@ def main(params):
for i,img in enumerate(imgs):
# load the image
I = imread(os.path.join(params['images_root'], img['file_path']))
- Ir = imresize(I, (256,256))
+ try:
+ Ir = imresize(I, (256,256))
+ except:
+ print 'failed resizing image %s' % (img['file_path'],)
+ raise
# handle grayscale input images
if len(Ir.shape) == 2:
Ir = Ir[:,:,np.newaxis] |
Okay here's the error I got:
The file is definitely corrupted (the file size is too small and most of it is just gray). The question is if it got corrupted during decompression on my side or if it's actually like that in the original train2014.zip file. I'll try to investigate. The image at mscoco.org: http://mscoco.org/explore/?id=167126 |
Note : The image COCO_train2014_000000167126.jpg was also corrupted on my side, so I put fresh new copy from http://mscoco.org/explore/?id=167126 and the preprocessing worked. https://msvocds.blob.core.windows.net/images/262993_z.jpg is an actual URL of the image. |
Thank you! I am going to close this issue and adjust the documentation to point to it. |
Hello, I wrote some scripts which may be useful: script |
47: 7 0.001135%
|
@Tejeshwarabm |
遇到了同样 的问题,不知道怎么解决.... |
针对这个错误:IOError: [Errno 2] No such file or directory: u'coco/images/train2014/COCO_train2014_000000152328.jpg' To address this error: IOError: [Errno 2] No such file or directory: u'coco/images/train2014/COCO_train2014_000152328.jpg' |
您好,请问您的意思是 data/coco/images/train2014和val2014吗? |
When I run "python2 scripts/prepro_feats.py --input_json data/dataset_coco.json --output_dir data/cocotalk", I got this error: |
I have been getting FileNotFound Error for 524 images in train2014, so i have written the script to remove those corrupted images from train2014 and its dependences in other json files. We can do the same for val2014, if the files are missing in that folder, only the folder names needs to be changed. https://github.com/Mayurji/Computer-Vision/blob/master/Image_Captioning/missingFile_cocodataset.py |
Edit: See @susemeee's comment below (the image
COCO_train2014_000000167126.jpg
is corrupted, and you can download a replacement at https://msvocds.blob.core.windows.net/images/262993_z.jpg)I was trying to run
prepro.py
but eventually ran into an issue inscipy
'spilutil
package (see below).I've installed all dependencies, run the
coco_preprocess.ipynb
, and downloadedtrain2014.zip
+val2014.zip
and extracted them intococo/images
.Am I missing something?
The text was updated successfully, but these errors were encountered: