-
Notifications
You must be signed in to change notification settings - Fork 278
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
inconsistency between GPU/CPU inference #78
Comments
ntedgi
changed the title
inconsistincy between GPU to CPU
inconsistency between GPU to CPU inference
Mar 27, 2020
ntedgi
changed the title
inconsistency between GPU to CPU inference
inconsistency between GPU/CPU inference
Mar 27, 2020
torch.no_grad() impacts the autograd engine and deactivate it. It will reduce memory usage and speed up computations but you won’t be able to backprop (which you don’t want in an eval script). |
#71 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
its not an floating point issue between devices and then only the certainty changes
on GPU i get (4/18) on CPU (16/18)
in order to hard code GPU and then CPU i follow this commit
6286a47
and change this 2 lines
line 20:
valid_output = torch.zeros(batch_size,max_len,feat_dim,dtype=torch.float32,device='cuda' if torch.cuda.is_available() else 'cpu')
...
Line 38:
self.device = "cuda" if torch.cuda.is_available() else "cpu"
one time to 'cpu' and in the other to 'cuda'
tested on:
Ubuntu 18.04
NVIDIA-SMI 435.21
Driver Version: 435.21
CUDA Version: 10.1
GeForce RTX 2070
Python 3.6
pytorch-transformers==1.2.0
torch==1.2.0
example : 18 posts
The text was updated successfully, but these errors were encountered: