Commit 9e5edc10 authored by Arya McCarthy's avatar Arya McCarthy Committed by Facebook Github Bot
Browse files

Give path when checkpoint can't be found (#1040)

Summary:
Pull Request resolved: https://github.com/pytorch/fairseq/pull/1040

Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/836

Reviewed By: myleott, liezl200

Differential Revision: D16889252

fbshipit-source-id: 45a1b6c1217fb099f0350096e38e1c7d83ea0a64
parent 4812f64b
...@@ -150,8 +150,8 @@ class Trainer(object): ...@@ -150,8 +150,8 @@ class Trainer(object):
self.get_model().load_state_dict(state['model'], strict=True) self.get_model().load_state_dict(state['model'], strict=True)
except Exception: except Exception:
raise Exception( raise Exception(
'Cannot load model parameters from checkpoint, ' 'Cannot load model parameters from checkpoint {}; '
'please ensure that the architectures match.' 'please ensure that the architectures match.'.format(filename)
) )
extra_state = state['extra_state'] extra_state = state['extra_state']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment