HolyBayes / pytorch_ard

Pytorch implementation of Variational Dropout Sparsifies Deep Neural Networks
MIT License
83 stars 16 forks source link

RuntimeError: Subtraction, the `-` operator, with a bool tensor is not supported #3

Closed bambi2511 closed 4 years ago

bambi2511 commented 4 years ago

Hi,

I am trying to install pytorch_ard to test variational dropout, but whatever the install of the library, the test script constantly fails with the same error:

Sparsification ratio: 11.880% Traceback (most recent call last): ... /pytorch_ard-0.2.1-py3.6.egg/torch_ard/torch_ard.py", line 70, in _update_sparse_weights File "/home/supercalculateur/environment/torch_ard/lib/python3.6/site-packages/torch/tensor.py", line 325, in rsub return _C._VariableFunctions.rsub(self, other) RuntimeError: Subtraction, the - operator, with a bool tensor is not supported. If you are trying to invert a mask, use the ~ or bitwise_not() operator instead.

I tried :

It must be silly, but I still can't figure out why I always get this error (either operation is not defined or tensor is wrongly a boolean one)

I use nvidia driver 430.26 with CUDA Version: 10.2 on ubuntu 18.04

Regards,

Francois

HolyBayes commented 4 years ago

Thanks for your comment! Fixed