From b203c9b7ffe89ae1b9182dc9516f627153fdeeac Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 29 Jun 2020 12:45:25 -0700 Subject: [PATCH] update train.py incompatible model message fix #222 --- train.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/train.py b/train.py index a572a37..39dd0e5 100644 --- a/train.py +++ b/train.py @@ -118,8 +118,9 @@ def train(hyp): if model.state_dict()[k].shape == v.shape} # to FP32, filter model.load_state_dict(ckpt['model'], strict=False) except KeyError as e: - s = "%s is not compatible with %s. Specify --weights '' or specify a --cfg compatible with %s." \ - % (opt.weights, opt.cfg, opt.weights) + s = "%s is not compatible with %s. This may be due to model differences or %s may be out of date. " \ + "Please delete or update %s and try again, or use --weights '' to train from scatch." \ + % (opt.weights, opt.cfg, opt.weights, opt.weights) raise KeyError(s) from e # load optimizer