Comments (8)
@RobinFrcd I've uploaded a new version 0.2.4 manually onto pypi, could you try upgrading it?
from pytorch_memlab.
Can you post the full stack trace and your PyTorch version?
from pytorch_memlab.
Using PyTorch 1.8.0+cu101 results in:
from pytorch_memlab import MemReporter
Results in:
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-4-f9afd24a6183> in <module>()
----> 1 from pytorch_memlab import MemReporter
5 frames
/usr/local/lib/python3.7/dist-packages/pytorch_memlab/__init__.py in <module>()
1 from .courtesy import Courtesy
2 from .mem_reporter import MemReporter
----> 3 from .line_profiler import LineProfiler, profile, profile_every, set_target_gpu, clear_global_line_profiler
4 try:
5 from .line_profiler.extension import load_ipython_extension
/usr/local/lib/python3.7/dist-packages/pytorch_memlab/line_profiler/__init__.py in <module>()
1 from .line_profiler import LineProfiler
----> 2 from .profile import profile, profile_every, set_target_gpu, clear_global_line_profiler
/usr/local/lib/python3.7/dist-packages/pytorch_memlab/line_profiler/profile.py in <module>()
4
5 global_line_profiler = LineProfiler()
----> 6 global_line_profiler.enable()
7
8
/usr/local/lib/python3.7/dist-packages/pytorch_memlab/line_profiler/line_profiler.py in enable(self)
88 try:
89 torch.cuda.empty_cache()
---> 90 self._reset_cuda_stats()
91 # Pytorch-1.7.0 raises AttributeError while <1.6.0 raises AssertionError
92 except (AssertionError, AttributeError) as error:
/usr/local/lib/python3.7/dist-packages/pytorch_memlab/line_profiler/line_profiler.py in _reset_cuda_stats(self)
80
81 def _reset_cuda_stats(self):
---> 82 torch.cuda.reset_peak_memory_stats()
83 torch.cuda.reset_accumulated_memory_stats()
84
/usr/local/lib/python3.7/dist-packages/torch/cuda/memory.py in reset_peak_memory_stats(device)
236 """
237 device = _get_device_index(device, optional=True)
--> 238 return torch._C._cuda_resetPeakMemoryStats(device)
239
240
RuntimeError: invalid argument to reset_peak_memory_stats
from pytorch_memlab.
Well it looks like pytorch's keeping changing the Error type
it raised for no GPU situation.
Can you try catch an extra RuntimeError
here at /usr/local/lib/python3.7/dist-packages/pytorch_memlab/line_profiler/line_profiler.py:92
from pytorch_memlab.
Probably we should use torch.cuda.is_available()
instead of try-catch
block.
from pytorch_memlab.
@Stonesjtu Hi and thanks for the fix!
Would it be possible to make a Pypi release with this MR ?
Thanks
from pytorch_memlab.
The travis-ci seems broken, working on that.
from pytorch_memlab.
@Stonesjtu Perfect, it works like a charm! Thank you very much for the prompt release! 👍
from pytorch_memlab.
Related Issues (20)
- Variable 'tensor_names' referenced before assignment HOT 1
- Redirect report() to the file HOT 3
- sparse tensors do not have storage HOT 1
- Documentation for pl.LightningModule that includes many nn.Modules HOT 6
- Fail to install using pip HOT 4
- Request: solving the lack of incremental reporting in loops / functions HOT 2
- turn profile decorator on and off HOT 2
- Jupyter Support Issues HOT 1
- Does not work with torch 1.7.1+ HOT 1
- is PyTorch Profiler Used Internally? HOT 3
- weakly-referenced object no longer exists HOT 2
- Question about Used Memory and GPU memory HOT 3
- Naming Tensors within MemReporter HOT 1
- OSError: could not get source code when running LineProfiler HOT 2
- What's the difference between `active_bytes` and `reserved_bytes`? HOT 3
- How to get memory diff between first and second batch? HOT 1
- Nor working HOT 4
- How do I record the maximum memory usage of a script?
- KeyError: "['XXX'] not in index" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch_memlab.