Restore config from checkpoint

Hello,

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!

You can write this little Lua script:

require('onmt.init')

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
  require('cutorch')
end
local checkpoint = torch.load(opt.model)
print(checkpoint.options)

place it in the OpenNMT directory and run it:

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