CapsNet-pytorch icon indicating copy to clipboard operation
CapsNet-pytorch copied to clipboard

Deprecated

Open raul1968 opened this issue 6 years ago • 2 comments

/home/raul/Desktop/CapsNet-pytorch/net.py:28: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument. c = F.softmax(self.b) /home/raul/Desktop/CapsNet-pytorch/net.py:38: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument. c = F.softmax(b_batch.view(-1, output_caps)).view(-1, input_caps, output_caps, 1) Traceback (most recent call last): File "/home/raul/Desktop/CapsNet-pytorch/net.py", line 275, in train(epoch) File "/home/raul/Desktop/CapsNet-pytorch/net.py", line 244, in train 100. * batch_idx / len(train_loader), loss.data[0])) IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number

raul1968 avatar Jul 20 '19 21:07 raul1968

use loss.item() instead of loss.data[0]

luo3300612 avatar Jul 22 '19 07:07 luo3300612

There were some breaking changes in newer PyTorch versions; I used version 0.3.0 when I was writing the code.

adambielski avatar Aug 14 '19 11:08 adambielski