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

the training procedure crash when input is list of tensor #2

Closed
zimenglan-sysu-512 opened this issue Aug 18, 2021 · 2 comments
Closed

Comments

@zimenglan-sysu-512
Copy link

when train the HAT, i meet this problem

 File "/home/tiger/hand-gestures/3rd/HAT/engine/trainer.py", line 46, in _update
   loss = loss_fn(score, feat, target)
 File "/home/tiger/hand-gestures/3rd/HAT/layers/__init__.py", line 40, in loss_func
   return F.cross_entropy(score, target) + triplet(feat, target)[0]
 File "/home/tiger/.local/lib/python3.7/site-packages/torch/nn/functional.py", line 2468, in cross_entropy
   return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
 File "/home/tiger/.local/lib/python3.7/site-packages/torch/nn/functional.py", line 1605, in log_softmax
   ret = input.log_softmax(dim)
AttributeError: 'list' object has no attribute 'log_softmax'

any idea to solve it?
thanks

@gwenzhang
Copy link

The input of F.cross_entropy(score) must be Tensor not list.

@Yarloy
Copy link

Yarloy commented May 18, 2022

same question, any solution plz?

@AI-Zhpp AI-Zhpp closed this as completed Feb 8, 2023
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

4 participants