Commit
·
b203c9b
1
Parent(s):
01895f3
update train.py incompatible model message fix #222
Browse files
train.py
CHANGED
@@ -118,8 +118,9 @@ def train(hyp):
|
|
118 |
if model.state_dict()[k].shape == v.shape} # to FP32, filter
|
119 |
model.load_state_dict(ckpt['model'], strict=False)
|
120 |
except KeyError as e:
|
121 |
-
s = "%s is not compatible with %s.
|
122 |
-
%
|
|
|
123 |
raise KeyError(s) from e
|
124 |
|
125 |
# load optimizer
|
|
|
118 |
if model.state_dict()[k].shape == v.shape} # to FP32, filter
|
119 |
model.load_state_dict(ckpt['model'], strict=False)
|
120 |
except KeyError as e:
|
121 |
+
s = "%s is not compatible with %s. This may be due to model differences or %s may be out of date. " \
|
122 |
+
"Please delete or update %s and try again, or use --weights '' to train from scatch." \
|
123 |
+
% (opt.weights, opt.cfg, opt.weights, opt.weights)
|
124 |
raise KeyError(s) from e
|
125 |
|
126 |
# load optimizer
|