salaniz / pycocoevalcap

Python 3 support for the MS COCO caption evaluation tools
Other
300 stars 84 forks source link

OSError: [Errno 22] Invalid argument #2

Closed ivy94419 closed 6 years ago

ivy94419 commented 6 years ago

I use python3.6 and tensorflow 1.4.0 in windows 10, and I put pycocoevalcap in this project https://github.com/yunjey/show-attend-and-tell, got some issues:

 File "D:/AIBU/image_caption/showAttendTell/train.py", line 22, in main
    solver.train()
  File "D:\AIBU\image_caption\showAttendTell\core\solver.py", line 172, in train
    scores = evaluate(data_path='./data', split='val', get_scores=True)  
  File "D:\AIBU\image_caption\showAttendTell\core\bleu.py", line 47, in evaluate
    final_scores = score(ref, hypo)
  File "D:\AIBU\image_caption\showAttendTell\core\bleu.py", line 21, in score
    score,scores = scorer.compute_score(ref,hypo)
  File "D:\AIBU\image_caption\showAttendTell\pycocoevalcap\meteor\meteor.py", line 38, in compute_score
    stat = self._stat(res[i][0], gts[i])
  File "D:\AIBU\image_caption\showAttendTell\pycocoevalcap\meteor\meteor.py", line 58, in _stat
    self.meteor_p.stdin.flush()
OSError: [Errno 22] Invalid argument

how to deal with it?

salaniz commented 6 years ago

Unfortunately, I currently cannot test the code on Windows.

Can you please tell me what the content of the variable score_line is before the error occurs? You could just print it after line 55 in pycocoevalcap\meteor\meteor.py.

ivy94419 commented 6 years ago

Already, I have fixed it, but I might doesn't change any code yet ... If any issues occur, I will ask you. Thank you!

homelifes commented 5 years ago

Hi @ivy94419 . May I know how you fixed the problem. I'm facing the same one

aniloc111 commented 4 years ago

Hi @ivy94419 . May I know how you fixed the problem. I'm facing the same one

Hi, do you already have answer for this?