Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: bool value of Variable objects containing non-empty torch.cuda.FloatTensor is ambiguous #12

Open
SeekPoint opened this issue Sep 26, 2018 · 1 comment

Comments

@SeekPoint
Copy link

mldl@ub1604:/ub16_prj/pytorch_RVAE$ python3 train_word_embeddings.py
preprocessed data was found and loaded
Traceback (most recent call last):
File "train_word_embeddings.py", line 47, in
out = neg_loss(input, target, args.num_sample).mean()
File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
File "/home/mldl/ub16_prj/pytorch_RVAE/selfModules/neg.py", line 38, in forward
assert parameters_allocation_check(self),
File "/home/mldl/ub16_prj/pytorch_RVAE/utils/functional.py", line 15, in parameters_allocation_check
return fold(f_and, parameters, True) or not fold(f_or, parameters, False)
File "/home/mldl/ub16_prj/pytorch_RVAE/utils/functional.py", line 2, in fold
return a if (len(l) == 0) else fold(f, l[1:], f(a, l[0]))
File "/home/mldl/ub16_prj/pytorch_RVAE/utils/functional.py", line 2, in fold
return a if (len(l) == 0) else fold(f, l[1:], f(a, l[0]))
File "/home/mldl/ub16_prj/pytorch_RVAE/utils/functional.py", line 6, in f_and
return x and y
File "/usr/local/lib/python3.5/dist-packages/torch/autograd/variable.py", line 123, in bool
torch.typename(self.data) + " is ambiguous")
RuntimeError: bool value of Variable objects containing non-empty torch.cuda.FloatTensor is ambiguous
mldl@ub1604:
/ub16_prj/pytorch_RVAE$

@berzentine
Copy link

How did you fix this? I am getting the same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants