--
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+unsubscribe@googlegroups.com.
To post to this group, send email to tor...@googlegroups.com.
Visit this group at https://groups.google.com/group/torch7.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to torch7+un...@googlegroups.com.
--
a:writeFloat(layer.weight:storage()) is wrong. you need to do:
local w = layer.weight
a:writeFloat(w:storage().new(w:storage(), w:storageOffset(), w:nElement())
On Thu, Nov 3, 2016 at 5:53 PM, fireman via torch7 <torch7+APn2wQeW3esQD-dFTzB55wMyBRX8xJbzqz3UhAPNuLWPpnI6ph...@googlegroups.com> wrote:
I tried that but seems there is something wrong. I just want to load a previous trained model, find the Convolution layer and dump the weight and bias to a file. Here is my codelocal model = //local a previous trained torch cnn mode from filelocal a = torch.DiskFile(opt.output..'.t7', 'w'):binary()for i = 1, #model dolocal layer = model:get(i)local layer_type = torch.type(layer)print(string.format('Layer %d: %s', i, layer_type))if layer_type == 'nn.SpatialConvolution' thenlayer:float()if opt.writedata thena:writeFloat(layer.weight:storage())a:writeFloat(layer.bias:storage())endendIt did write to a file, but the file size is very big, it is even bigger than my original model.
--
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.