ruotianluo / self-critical.pytorch

Unofficial pytorch implementation for Self-critical Sequence Training for Image Captioning. and others.
MIT License
996 stars 279 forks source link

ModuleNotFoundError: No module named 'mask' #213

Closed batooooo closed 4 years ago

batooooo commented 4 years ago

Hi, when i train using self critical, i got this error

Traceback (most recent call last): File "tools/train.py", line 22, in import captioning.utils.eval_utils as eval_utils File "/home/bg/BG/self-critical.pytorch/captioning/utils/eval_utils.py", line 19, in from pycocotools.coco import COCO File "/home/bg/anaconda3/lib/python3.7/site-packages/pycocotools/coco.py", line 58, in import mask ModuleNotFoundError: No module named 'mask'

how do i fix it?

ruotianluo commented 4 years ago

I feel like its because package conflicts. You should be using pycocotools in coco-caption folder, not the pycocotools for instance segmentation.

batooooo commented 4 years ago

thank you. i try to using pycocotools in coco-caption folder, but i got this error

Traceback (most recent call last): File "tools/train.py", line 288, in train(opt) File "tools/train.py", line 242, in train dp_model, lw_model.crit, loader, eval_kwargs) File "/home/bg/BG/self-critical.pytorch/captioning/utils/eval_utils.py", line 224, in eval_split lang_stats = language_eval(dataset, predictions, n_predictions, eval_kwargs, split) File "/home/bg/BG/self-critical.pytorch/captioning/utils/eval_utils.py", line 76, in language_eval coco = getCOCO(dataset) File "/home/bg/BG/self-critical.pytorch/captioning/utils/eval_utils.py", line 46, in getCOCO return COCO(annFile) NameError: name 'COCO' is not defined

ruotianluo commented 4 years ago

Did you see 'Warning: coco-caption not available'