ruotianluo / ImageCaptioning.pytorch

I decide to sync up this repo and self-critical.pytorch. (The old master is in old master branch for archive)
MIT License
1.44k stars 412 forks source link

A problem occured when finished validation"No such file or directory: 'data/coco.json'`" #177

Closed buyongbaoqian closed 1 year ago

buyongbaoqian commented 1 year ago

Traceback (most recent call last): File "D:\pycharm\PyCharm Community Edition 2022.3.2\plugins\python-ce\helpers\pydev\pydevd.py", line 1496, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "D:\pycharm\PyCharm Community Edition 2022.3.2\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "D:\ImageCaptioning.pytorch-master\tools\train.py", line 296, in <module> train(opt) File "D:\ImageCaptioning.pytorch-master\tools\train.py", line 37, in train loader = DataLoader(opt) File "D:\ImageCaptioning.pytorch-master\captioning\data\dataloader.py", line 308, in __init__ self.dataset = Dataset(opt) File "D:\ImageCaptioning.pytorch-master\captioning\data\dataloader.py", line 109, in __init__ self.info = json.load(open(self.opt.input_json)) FileNotFoundError: [Errno 2] No such file or directory: 'data/coco.json'

ruotianluo commented 1 year ago

You need to specify the --input_json or use a preexisting config. https://github.com/ruotianluo/ImageCaptioning.pytorch#start-training

buyongbaoqian commented 1 year ago

Thanks!I‘ll try.