--
You received this message because you are subscribed to the Google Groups "torch7" group.
To unsubscribe from this group and stop receiving emails from it, send an email to torch7+un...@googlegroups.com.
To post to this group, send email to tor...@googlegroups.com.
Visit this group at http://groups.google.com/group/torch7.
For more options, visit https://groups.google.com/d/optout.
If I was to guess, I would say that you're not doing a "require 'nn'" before loading.
I just posted a new code snippet to that old issue for you. It describes how to zero the tensors in a model before saving them to disk to reduce on disk filesize.I would say that you only need to save the optim state if you want to continue training using SGD from where you left off. If you just want to save the model in order to run FPROP through it at a later date then you don't need it. Does that make sense?Maybe have a look in the sgd method in optim to try and understand what state it actually uses and what state you will need for restarting training.
Sravan, your code to load is wrong.
You have to do:
weights: copy(torch.load(...))
Why don't you just serialize the entire model? Sorry, I thought that's what you were doing.
On Wed, Feb 18, 2015 at 9:05 PM, torch7 on behalf of smth chntla <tor...@googlegroups.com> wrote:
Sravan, your code to load is wrong.
You have to do:
weights: copy(torch.load(...))
--
sanitize = function (net) local list = net:listModules() for _,val in ipairs(list) do for name,field in pairs(val) do if torch.type(field) == 'cdata' then val[name] = nil end if (name == 'output' or name == 'gradInput') then val[name] = field.new() end end end end
Visit this group at https://groups.google.com/group/torch7.
If you have latest torch, you can now do:
model:clearState()