Atcold / pytorch-CortexNet

PyTorch implementation of the CortexNet predictive model

Home Page:http://tinyurl.com/CortexNet/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RuntimeError: bool value of Tensor with more than one value is ambiguous

navneeth opened this issue · comments

commented

Hello,
Thank you for your excellent work.

While attempting to reproduce your results using
python = 3.6
pytorch = 0.4.1

I get the following error
 File "/pytorch-CortexNet-master/model/Model02.py", line 76, in forward
    s = state[layer - 1] or V(x.data.clone().zero_())
RuntimeError: bool value of Tensor with more than one value is ambiguous

Seems related to the variables & tensors merge from 0.3 -> 0.4. Could you please provide a suggestion.

commented

Been looking at the migration guide: https://pytorch.org/blog/pytorch-0_4_0-migration-guide/
Does this change make sense:

V(x.data.clone().zero_()) 
 to
x.data.clone().zero_()

But the real problem seems to be comparison of state[layer-1] (scalar) to V(x.data.clone().zero_()) which is a tensor.

Read the existing issue.

screenshot 2018-11-11 21 50 01