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

ImageCaptionRetrieval doesn't work with Infersent #57

Open
xuwenshen opened this issue Jan 15, 2019 · 2 comments
Open

ImageCaptionRetrieval doesn't work with Infersent #57

xuwenshen opened this issue Jan 15, 2019 · 2 comments

Comments

@xuwenshen
Copy link

Traceback (most recent call last):
File "infersent.py", line 75, in
results = se.eval(transfer_tasks)
File "../senteval/engine.py", line 59, in eval
self.results = {x: self.eval(x) for x in name}
File "../senteval/engine.py", line 59, in
self.results = {x: self.eval(x) for x in name}
File "../senteval/engine.py", line 119, in eval
self.evaluation.do_prepare(self.params, self.prepare)
File "../senteval/rank.py", line 39, in do_prepare
prepare(params, samples)
File "infersent.py", line 38, in prepare
params.infersent.build_vocab([' '.join(s) for s in samples], tokenize=False)
File "infersent.py", line 38, in
params.infersent.build_vocab([' '.join(s) for s in samples], tokenize=False)
TypeError: sequence item 0: expected str instance, bytes found

@shibu38
Copy link

shibu38 commented Mar 9, 2019

Hi @xuwenshen,
I am facing the same problem..
Did you find the solution, if yes then can you please share..
Thanks in advance

@SCULX
Copy link

SCULX commented Mar 22, 2024

Traceback (most recent call last): File "infersent.py", line 75, in results = se.eval(transfer_tasks) File "../senteval/engine.py", line 59, in eval self.results = {x: self.eval(x) for x in name} File "../senteval/engine.py", line 59, in self.results = {x: self.eval(x) for x in name} File "../senteval/engine.py", line 119, in eval self.evaluation.do_prepare(self.params, self.prepare) File "../senteval/rank.py", line 39, in do_prepare prepare(params, samples) File "infersent.py", line 38, in prepare params.infersent.build_vocab([' '.join(s) for s in samples], tokenize=False) File "infersent.py", line 38, in params.infersent.build_vocab([' '.join(s) for s in samples], tokenize=False) TypeError: sequence item 0: expected str instance, bytes found

I just directly change ' ' into b" " in both functions prepare and batcher , like this

params.infersent.build_vocab([b" ".join(s) for s in samples], tokenize=False) 

and it works!

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

3 participants