chaoyuaw / pytorch-coviar

Compressed Video Action Recognition
https://www.cs.utexas.edu/~cywu/projects/coviar/
GNU Lesser General Public License v2.1
502 stars 126 forks source link

Encounter the problem "IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number", when I tried to train on HMDB51. #40

Closed ZealACMer closed 5 years ago

ZealACMer commented 5 years ago

To be more specific, when I tried to use the following commands: image I encountered the problem as shown in the following pic: image I have not find the appropriate solution for this problem, can you help me? Thank you very much.

ZealACMer commented 5 years ago

When I tried to change loss.data[0] to loss.item(), but encountered another problem, error message is shown as follows: image

How can I solve this, thank you very much.

ZealACMer commented 5 years ago

I have solved this problem, thank you every much.

yellowjs0304 commented 5 years ago

@ZealACMer Hi, How did you resolve the problem? I encountered same issue.

abhijeeetkumar commented 3 years ago

What was the fix?