Skip to content

AttributeError: 'Elmo' object has no attribute 'batch_to_embeddings' #10

Description

@vvincenttttt

File "main.py", line 50, in response_pred
json_list = durationAPI.pred(events)
File "../Duration/inference_api.py", line 84, in pred
outputs = compute_predictions(self.model, test_loader)
File "/home/tianhao/anaconda3/envs/event-pipeline/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 49, in decorate_no_grad
return func(*args, **kwargs)
File "../Duration/utils_duration.py", line 40, in compute_predictions
p1_dur, p2_dur, fine, rel = model(words, span, root)
File "/home/tianhao/anaconda3/envs/event-pipeline/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/tianhao/relation_extraction/EventPlus/component/Duration/scripts/src/factslab/factslab/pytorch/temporalmodule.py", line 241, in forward
inputs, masks = self.elmo_class.batch_to_embeddings(structures)
File "/home/tianhao/anaconda3/envs/event-pipeline/lib/python3.7/site-packages/torch/nn/modules/module.py", line 576, in getattr
type(self).name, name))
AttributeError: 'Elmo' object has no attribute 'batch_to_embeddings'

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