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

utils.py in references can't work with pytorch-cpu #1023

Merged
merged 2 commits into from
Jun 14, 2019
Merged

utils.py in references can't work with pytorch-cpu #1023

merged 2 commits into from
Jun 14, 2019

Conversation

LXYTSOS
Copy link
Contributor

@LXYTSOS LXYTSOS commented Jun 14, 2019

These codes can work well when I use a GPU version pytorch, and today I train a model use a CPU version, I got AssertionError: Torch not compiled with CUDA enabled, and then I trace the code I found this code in utils.py:memory=torch.cuda.max_memory_allocated(), so I use torch.cuda.is_available() to fix it:

if torch.cuda.is_available():
    print(log_msg.format(
        i, len(iterable), eta=eta_string,
        meters=str(self),
        time=str(iter_time), data=str(data_time),
        memory=torch.cuda.max_memory_allocated() / MB))

LXYTSOS added 2 commits June 15, 2019 00:21
utils.py can't work with pytorch-cpu because of this line of code `memory=torch.cuda.max_memory_allocated()`
utils.py can't work with pytorch-cpu because of this line of code 'memory=torch.cuda.max_memory_allocated()'
@codecov-io
Copy link

codecov-io commented Jun 14, 2019

Codecov Report

Merging #1023 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1023   +/-   ##
=======================================
  Coverage   63.29%   63.29%           
=======================================
  Files          65       65           
  Lines        5152     5152           
  Branches      772      772           
=======================================
  Hits         3261     3261           
  Misses       1667     1667           
  Partials      224      224

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2694a5d...fca5139. Read the comment docs.

@soumith soumith merged commit 250bac8 into pytorch:master Jun 14, 2019
@soumith
Copy link
Member

soumith commented Jun 14, 2019

thanks!

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

Successfully merging this pull request may close these issues.

3 participants