RuntimeError: bool value of Tensor with more than one value is ambiguous
navneeth opened this issue · comments
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.
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.