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

Demo not working #26

Open
jakwisn opened this issue Jan 12, 2021 · 3 comments
Open

Demo not working #26

jakwisn opened this issue Jan 12, 2021 · 3 comments

Comments

@jakwisn
Copy link

jakwisn commented Jan 12, 2021

Hi!
I was trying to run the demo.ipynb but found that it does not work for me

RuntimeError                              Traceback (most recent call last)
<ipython-input-12-87b1f64074ed> in <module>
     13     logit = model(X_train)
     14     loss = criterion(logit.view(-1), y_train)
---> 15     loss +=  dp_loss(X_train, logit, sensi_train)
     16     loss.backward()
     17     optimizer.step()

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

Setting the selft.device to cpu fixes it but using gpu would be nice.

Great package btw :)

My system info: 
-----
fairtorch           NA
numpy               1.18.5
pydev_jupyter_vars  NA
sinfo               0.3.1
torch               1.7.1
-----
IPython             7.19.0
jupyter_client      6.1.7
jupyter_core        4.7.0
notebook            6.1.5
-----
Python 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
Linux-5.4.0-52-generic-x86_64-with-glibc2.29
12 logical CPU cores, x86_64
-----
Session information updated at 2021-01-12 13:20
@MasashiSode
Copy link
Collaborator

thank you for your report!
can you run this example?

@jakwisn
Copy link
Author

jakwisn commented Jan 13, 2021

That one works for me

@MasashiSode
Copy link
Collaborator

@jakwisn
thank you! i beg the demo.ipynb is not updated. we will update it soon.

@akiFQC
I think we need to update the demo.ipynb

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