You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having an issue with properly deleting PyTorch objects from memory. With this dummy class:
require 'nn'
require 'cunn'
require 'cutorch'
local Test = torch.class('Test')
function Test:__init()
self.tensor = torch.CudaTensor(10000, 10000)
end
If I instantiate from Python:
>>> from PyTorchHelpers import load_lua_class
>>> Test = load_lua_class('modules/test.lua', 'Test')
>>> test = Test()
Then delete the object:
>>> del test
CUDA memory is not freed up.
Is there a clean way to delete a PyTorch object from memory?
The text was updated successfully, but these errors were encountered:
cjmcmurtrie
changed the title
How to remove PyTorch objects correctly from within Python?
How to remove PyTorch objects correctly from memory within Python?
Oct 5, 2016
cjmcmurtrie
changed the title
How to remove PyTorch objects correctly from memory within Python?
How to delete PyTorch objects correctly from memory within Python?
Oct 5, 2016
Ah, yes, this is probably connected to #10 (comment) It's kind of non-trivial to fix, but probably should be fixed... Probably need some kind of gc command perhaps. If memory was freed iff one called a new hypothetical PyTorch.gc() command, to what extent could that be acceptable-ish?
I'm having an issue with properly deleting PyTorch objects from memory. With this dummy class:
If I instantiate from Python:
Then delete the object:
CUDA memory is not freed up.
Is there a clean way to delete a PyTorch object from memory?
The text was updated successfully, but these errors were encountered: