Kaynağa Gözat

FP16 to FP32 ckpt load

5.0
Glenn Jocher 4 yıl önce
ebeveyn
işleme
14523bb030
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. +2
    -2
      train.py

+ 2
- 2
train.py Dosyayı Görüntüle

@@ -112,8 +112,8 @@ def train(hyp):

# load model
try:
ckpt['model'] = \
{k: v for k, v in ckpt['model'].state_dict().items() if model.state_dict()[k].numel() == v.numel()}
ckpt['model'] = {k: v for k, v in ckpt['model'].float().state_dict().items()
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." \

Yükleniyor…
İptal
Kaydet