dawn-bench-models icon indicating copy to clipboard operation
dawn-bench-models copied to clipboard

RuntimeError: dimension specified as 0 but tensor has no dimensions

Open ticlazau opened this issue 6 years ago • 1 comments

Hi,

I am having bellow issue running with Pytorch 0.5:

/Users/coredump/DL/dawn-bench-models/pytorch/CIFAR10/benchmark/cifar10/train.py:113: UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use tensor.item() to convert a 0-dim tensor to a Python number losses.update(loss.data[0], batch_size) /Users/coredump/DL/dawn-bench-models/pytorch/CIFAR10/benchmark/cifar10/train.py:76: UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use tensor.item() to convert a 0-dim tensor to a Python number tops = list(map(lambda k: corrects.data[0][k - 1], top)) Traceback (most recent call last): File "/Users/coredump/anaconda3/bin/cifar10", line 11, in load_entry_point('benchmark', 'console_scripts', 'cifar10')() File "/Users/coredump/anaconda3/lib/python3.6/site-packages/click/core.py", line 722, in call return self.main(*args, **kwargs) File "/Users/coredump/anaconda3/lib/python3.6/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/Users/coredump/anaconda3/lib/python3.6/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Users/coredump/anaconda3/lib/python3.6/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/Users/coredump/anaconda3/lib/python3.6/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/Users/coredump/DL/dawn-bench-models/pytorch/CIFAR10/benchmark/cifar10/train.py", line 347, in train half=half) File "/Users/coredump/DL/dawn-bench-models/pytorch/CIFAR10/benchmark/cifar10/train.py", line 116, in run top_correct = correct(outputs, targets, top=top) File "/Users/coredump/DL/dawn-bench-models/pytorch/CIFAR10/benchmark/cifar10/train.py", line 76, in correct tops = list(map(lambda k: corrects.data[0][k - 1], top)) File "/Users/coredump/DL/dawn-bench-models/pytorch/CIFAR10/benchmark/cifar10/train.py", line 76, in tops = list(map(lambda k: corrects.data[0][k - 1], top)) RuntimeError: dimension specified as 0 but tensor has no dimensions

Any ideas?

Rgds, FM

ticlazau avatar Jul 10 '18 23:07 ticlazau

Is this project abandoned? Is there any update related to same issue after 3 years?

I am still having the same problem, please see https://github.com/stanford-futuredata/dawn-bench-models/issues/7

avatar-lavventura avatar Dec 07 '21 18:12 avatar-lavventura