Skip to content

argument 'tensors' (position 1) must be tuple of Tensors, not str #23

@Crista23

Description

@Crista23

How to fix the error below? Thank you!

$ python3 example.py
Traceback (most recent call last):
File "example.py", line 79, in
test_sentence_score()
File "example.py", line 72, in test_sentence_score
mover = sentence_score(sys, refs)
File "example.py", line 23, in sentence_score
scores = word_mover_score(references, hypothesis, idf_dict_ref, idf_dict_hyp, stop_words=[], n_gram=1, remove_subwords=False)
File "/usr/lib/python3.7/site-packages/moverscore_v2.py", line 128, in word_mover_score
device=device)
File "/usr/lib/python3.7/site-packages/moverscore_v2.py", line 100, in get_bert_embedding
batch_embedding = torch.stack(batch_embedding)
TypeError: stack(): argument 'tensors' (position 1) must be tuple of Tensors, not str

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions