CaptionMetrics
CaptionMetrics copied to clipboard
an error in meteor
self.meteor_p.stdin.write('{}\n'.format(score_line)) TypeError: a bytes-like object is required, not 'str'
add encode('utf-8')
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.
did you met this question?
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/
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.)
我在香料上遇到了同样的问题! 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()