Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Issue when running the test #10

Open
KristianDukov opened this issue Dec 23, 2018 · 2 comments
Open

Issue when running the test #10

KristianDukov opened this issue Dec 23, 2018 · 2 comments

Comments

@KristianDukov
Copy link

Running on Windows 10
Python Python 3.6.7

When trying to run the test with the given model from google drive and the dataset, I get the following error:

TEST on Directions
�[?25lTraceback (most recent call last):
File "main.py", line 283, in
main(option)
File "main.py", line 94, in main
_, err_test = test(test_loader, model, criterion, stat_3d, procrustes=opt.procrustes)
File "main.py", line 228, in test
losses.update(loss.data[0], inputs.size(0))
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number

@weigq
Copy link
Owner

weigq commented Dec 25, 2018

seems you are using a lastest version of pytorch. You can try replace the loss.data[0] with loss.item()

@NguyenDangBinh
Copy link

dear @weigq,
It conduct well on Ubuntu 18, Anaconda, Python 2.7, Pytorch 1.1 cuda. (replace the loss.data[0] with loss.item())

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants