davidnvq/grit

inference error

Dufresue opened this issue · 2 comments

when i follow the installation tutorial, downloaded dataset and checkpoints, and try to perform Inference for a single image using the inference_caption.py. there comes some errors.
微信图片_20231106194710
i don't know how to fix it and somebody help me?

First, make sure to copy the files in data/ (including vocab.json - see files here) to the above annotations folder. It includes vocab.json and some files containing Karapthy ids. Your coco dataset should have the following structure:

path/to/coco_caption/
├── annotations/  # annotation json files and Karapthy files
├── train2014/    # train images
├── val2014/      # val images
└── test2014/     # test images

Second, when running inference, please run:

export DATA_ROOT=path/to/coco_caption

before:

python eval_caption.py +split='valid' exp.checkpoint=path_to_caption_checkpoint

Hope this helps.

thanks very much,it works !

First, make sure to copy the files in data/ (including vocab.json - see files here) to the above annotations folder. It includes vocab.json and some files containing Karapthy ids. Your coco dataset should have the following structure:

path/to/coco_caption/
├── annotations/  # annotation json files and Karapthy files
├── train2014/    # train images
├── val2014/      # val images
└── test2014/     # test images

Second, when running inference, please run:

export DATA_ROOT=path/to/coco_caption

before:

python eval_caption.py +split='valid' exp.checkpoint=path_to_caption_checkpoint

Hope this helps.

thanks, it works!