yufengm / Adaptive

Pytorch Implementation of Knowing When to Look: Adaptive Attention via A Visual Sentinel for Image Captioning
107 stars 42 forks source link

When I try to run train.py the attribute error occurs #11

Closed harryjhnam closed 3 years ago

harryjhnam commented 5 years ago

Hello,

When I try to run the 'train.py' there comes this error.

Traceback (most recent call last): File "train.py", line 263, in main( args ) File "train.py", line 176, in main cider = coco_eval( adaptive, args, epoch ) File "/home/harryjhnam/Documents/final_project/Adaptive/utils.py", line 120, in coco_eval CocoEvalLoader( args.image_dir, args.caption_val_path, transform ).samples AttributeError: 'CocoEvalLoader' object has no attribute 'samples'

I have modified your code for python3.5.2 and also tried on the python2.7 with your original code, but both methods occur the same error.

xuyu0010 commented 5 years ago

Hi, I am also hitting this Attribute Error, any clues on how to solve this? Thank you!

wangru26 commented 5 years ago

Hi,I also have this problem, have you solved it?Thanks !

WWWWWLI commented 4 years ago

I imitate data_loader.py add len function to class CocoEvalLoader which in utils.py The definition of len function is def __len__(self): return len(self.imgs)

hyojin-ki commented 4 years ago

@WWWWWLI Hi. I also have this problem, but solved it thanks to you! Thank you!