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

AttributeError: 'str' object has no attribute 'size' #133

Open
qiqirilige opened this issue Dec 16, 2024 · 0 comments
Open

AttributeError: 'str' object has no attribute 'size' #133

qiqirilige opened this issue Dec 16, 2024 · 0 comments

Comments

@qiqirilige
Copy link

Traceback (most recent call last):
File "train.py", line 341, in
train(args, device_id)
File "train.py", line 273, in train
trainer.train(train_iter_fct, args.train_steps)
File "/users/qqrlg/.conda/envs/Bertsum/BertSum-master/src/models/trainer.py", line 157, in train
report_stats)
File "/users/qqrlg/.conda/envs/Bertsum/BertSum-master/src/models/trainer.py", line 321, in _gradient_accumulation
sent_scores, mask = self.model(src, segs, clss, mask, mask_cls)
File "/users/qqrlg/.local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/users/qqrlg/.conda/envs/Bertsum/BertSum-master/src/models/model_builder.py", line 102, in forward
sents_vec = top_vec[torch.arange(top_vec.size(0)).unsqueeze(1), clss]
AttributeError: 'str' object has no attribute 'size'

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

1 participant