Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

an error in meteor #1

Open
kangkang59812 opened this issue Jun 17, 2019 · 5 comments
Open

an error in meteor #1

kangkang59812 opened this issue Jun 17, 2019 · 5 comments

Comments

@kangkang59812
Copy link

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

@liyuejul
Copy link

liyuejul commented Jul 1, 2019

add encode('utf-8')

@zhangxuying1004
Copy link

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
Copy link

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/

@umemurak
Copy link

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.)

@zhuhaifengaaa
Copy link

zhuhaifengaaa commented Mar 24, 2022

我在香料上遇到了同样的问题! 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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants