Comments (5)
I got the same issue on Linux with 32 GB of RAM.
from rl.
The output of this network is of size [1, 1000, 7, 215168] which is about 48Gb
import torch
import torchrl
import sys
input = torch.rand((1, 1000, 7, 3, 88, 88), dtype=torch.float32, device="meta")
print(sys.getsizeof(input.storage())/ 1_000_000, " MB") # This prints 650.496048 MB
net = torchrl.modules.ConvNet(in_features=3)
print(net(input).shape)
from rl.
How did you get 48Gb?
I am getting that it should be 6Gb
output = torch.rand((1, 1000, 7, 215168), dtype=torch.float32)
print(sys.getsizeof(output.storage()) / 1_000_000, " MB") # 6024.704048 MB
from rl.
Without no_grad you are saving each intermediate activation in a computational graph for backward calls
this runs
import torch
import torchrl
import sys
input = torch.rand((1, 1000, 7, 3, 88, 88), dtype=torch.float32)
print(sys.getsizeof(input.storage())/ 1_000_000, " MB") # This prints 650.496048 MB
net = torchrl.modules.ConvNet(in_features=3)
with torch.no_grad():
print(net(input).shape)
In general I wouldn't advise to call a non-customized conv net on 7000 elements at once on a laptop.
See this recent post on how to profile how big your call is going to be
https://dev-discuss.pytorch.org/t/how-to-measure-memory-usage-from-your-model-without-running-it/2024
from rl.
Got it. Thanks a lot for this!
from rl.
Related Issues (20)
- [BUG] Incorrect default value for `normalize_advantage`.
- [Feature Request] Return depth from RoboHiveEnv
- [BUG?] How to handle next with custom environment and check_env_specs() HOT 2
- [QUESTION] How to reset only certain nested parts of a key with TensorDictPrimer? HOT 3
- [Feature Request] DDPG with discrete actions HOT 4
- Achieving Episode-Based Sampling with SliceSampler in TorchRL HOT 2
- [BUG] Documentation Error: `MaskedEnv` Example Under ActionMask Transform Throws TypeError HOT 1
- [BUG] Buffer crashes on `extend` HOT 4
- Tutorial of implementing learning using torchrl in a PettingZoo environment HOT 4
- [BUG] default snapshot backend doesn't match docs HOT 1
- [Feature Request] Move `sota-check` inside `sota-implementations` HOT 8
- Errors reported in this section of USING PRETRAINED MODELS HOT 1
- [Feature Request] Handling of unserializable policies HOT 8
- In the Doc “RECURRENT DQN: TRAINING RECURRENT POLICIES” HOT 1
- [BUG] `DTypeCastTransform` changes arbitrary keys HOT 5
- [BUG] Transpose bug in `reward2go` when the last dim is not 1
- [BUG] VSCode automcompletions don't work HOT 2
- [Bug/Question] Target workflow for LSTM Modules?
- [Docs] - Clarify multi collector HOT 3
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 rl.