Error with command "python prepro.py -download 1 -image_root /path/to/coco/images
yellowjs0304 opened this issue · comments
Jisu Hwang commented
Hi, I have an issue at prepro.py file.
I did "python prepro.py -download 1 -image_root /path/to/coco/images"
It returns
python prepro.py -download 1 -image_root /path/to/coco/images
/home/ai8503/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
usage: prepro.py [-h] [-download] [-train_split {train,trainval}]
[-input_json_train INPUT_JSON_TRAIN]
[-input_json_val INPUT_JSON_VAL]
[-input_json_test INPUT_JSON_TEST] [-image_root IMAGE_ROOT]
[-input_vocab INPUT_VOCAB] [-output_json OUTPUT_JSON]
[-output_h5 OUTPUT_H5] [-max_ques_len MAX_QUES_LEN]
[-max_ans_len MAX_ANS_LEN] [-max_cap_len MAX_CAP_LEN]
[-word_count_threshold WORD_COUNT_THRESHOLD]
prepro.py: error: unrecognized arguments: 1
So, I changed this command to "python prepro.py -downalod -image_root /path/to/coco/images", and it worked well. But I have an issue at line 286.
Saving hdf5...
[train2014] Preparing image paths with image_ids...
0%| | 0/82783 [00:00<?, ?it/s]
Traceback (most recent call last):
File "prepro.py", line 286, in <module>
out['unique_img_train'] = get_image_ids(data_train, args, 'train')
File "prepro.py", line 188, in get_image_ids
image_ids[i] = id2path[image_id]
KeyError: 378466
I think that the json file seems to be the problem.
How can I solve this problem?
Abhishek Das commented
The image path is invalid. You'll have to download COCO train2014 / val2014 images from http://cocodataset.org/#download, and replace /path/to/coco/images
with the actual path to COCO images.