fartashf/vsepp

Much mistake on running vocab.py

chirstinaFan opened this issue · 3 comments

Traceback (most recent call last):
File "/Users/jiapei.fjp/Documents/python_project/vsepp/vocab.py", line 121, in
main(opt.data_path, opt.data_name)
File "/Users/jiapei.fjp/Documents/python_project/vsepp/vocab.py", line 109, in main
vocab = build_vocab(data_path, data_name, jsons=annotations, threshold=4)
File "/Users/jiapei.fjp/Documents/python_project/vsepp/vocab.py", line 79, in build_vocab
captions = from_coco_json(full_path)
File "/Users/jiapei.fjp/Documents/python_project/vsepp/vocab.py", line 46, in from_coco_json
coco = COCO(path)
File "/Users/jiapei.fjp/venv/download_urls/lib/python2.7/site-packages/pycocotools/coco.py", line 84, in init
dataset = json.load(open(annotation_file, 'r'))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py", line 290, in load
**kw)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

This script requires the contents of data.tar. Please refer to the instructions in the section "Download Data" in the readme file.

We refer to the path of extracted files for data.tar as $DATA_PATH and files for models.tar as $RUN_PATH. Extract vocab.tar to ./vocab directory.

I have done it,But it does not work!

Can you add this print(full_path) before this line:
https://github.com/fartashf/vsepp/blob/master/vocab.py#L77

Then check if the file given by that print statement exists and is readable.