3d_pose_baseline_pytorch icon indicating copy to clipboard operation
3d_pose_baseline_pytorch copied to clipboard

Issue when running the test

Open KristianDukov opened this issue 6 years ago • 2 comments
trafficstars

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

KristianDukov avatar Dec 23 '18 19:12 KristianDukov

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

weigq avatar Dec 25 '18 02:12 weigq

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

NguyenDangBinh avatar Apr 10 '19 10:04 NguyenDangBinh