AaronJackson / vrn

:man: Code for "Large Pose 3D Face Reconstruction from a Single Image via Direct Volumetric CNN Regression"
http://aaronsplace.co.uk/papers/jackson2017recon/
MIT License
4.52k stars 742 forks source link

clearState before save the net #38

Closed cloudhan closed 6 years ago

cloudhan commented 6 years ago

The vrn-unguided.t7 file is about 1.4GB. however if I simply dump the parameters with:

local nn = require("nn")
local image = require("image")
net = torch.load("/path/to/vrn-unguided.t7")
params = net:parameters()
torch.save("/path/to/vrn-params.t7", params)

The vrn-params.t7 is only 74MB.

with issue

net = net:clearState()
torch.save("/path/to/vrn-light.t7", net)

the vrn-light.t7 will be only 148MB

I haven't test the dumped model, but I think this will help you more easily distribute your model.

AaronJackson commented 6 years ago

Ah yeah, I'll update the model at some point. Thanks