CaptionMetrics icon indicating copy to clipboard operation
CaptionMetrics copied to clipboard

an error in meteor

Open kangkang59812 opened this issue 5 years ago • 5 comments

self.meteor_p.stdin.write('{}\n'.format(score_line)) TypeError: a bytes-like object is required, not 'str'

kangkang59812 avatar Jun 17 '19 14:06 kangkang59812

add encode('utf-8')

liyuejul avatar Jul 01 '19 12:07 liyuejul

add encode('utf-8')

hello, i met the same question, i did like below, self.meteor_p.stdin.write('{}\n'.format(score_line).encode('utf-8') the bug is over, however, the code keeps running, and no meteor result appear. image did you met this question?

zhangxuying1004 avatar Oct 24 '19 02:10 zhangxuying1004

i met the same question on spice! json.dump(input_data, in_file, indent=2) TypeError: a bytes-like object is required, not 'str'

input_data is a list composed of dict, in_file is a tempfile.NamedTemporaryFile/

zhangxuying1004 avatar Oct 24 '19 02:10 zhangxuying1004

I met this problem. (I couldn't use Meteor and Spice) I changed their codes in "pycocoevalcap" into those in https://github.com/salaniz/pycocoevalcap. Then, I could do with no problem. I don't know why.(I may know when I check the difference between them.)

umemurak avatar May 21 '20 02:05 umemurak

我在香料上遇到了同样的问题! json.dump(input_data, in_file, indent=2) TypeError: a bytes-like object is required, not 'str'

input_data是dict组成的list,in_file是tempfile.NamedTemporaryFile/

Hello, I have found a solution to this problem,

in meteor.py:

56 self.meteor_p.stdin.write('{}\n'.format(score_line).encode())
57 self.meteor_p.stdin.flush()
58 return self.meteor_p.stdout.readline().decode().strip()

zhuhaifengaaa avatar Mar 24 '22 09:03 zhuhaifengaaa