Restore config from checkpoint

(Dominik Macháček) #1


can I ask you whether it’s possible to restore as much as possible translation training configurations only from checkpoint? I have a model which was trained for several weeks and gives good results. I saved several but lost the log, config and bash history. Now I want to document it.

Is there a way how to get it? Do I need the preprocessed data for it?

I used OpenNMT-Lua, but I’m not a Lua programmer. I would prefer to do it with a bashscript, if possible.

Thank you!

(Guillaume Klein) #2

You can write this little Lua script:


local cmd = torch.CmdLine()
cmd:option('-model', '', 'trained model file')
cmd:option('-gpuid', 0, 'gpu id to load gpu model')
local opt = cmd:parse(arg)

if opt.gpuid > 0 then
local checkpoint = torch.load(opt.model)

place it in the OpenNMT directory and run it:

th dump_options.lua -gpuid 1 -model model.t7