ソースを参照

FP16 to FP32 ckpt load

5.0
Glenn Jocher 4年前
コミット
76ca367a01
2個のファイルの変更2行の追加2行の削除
  1. +1
    -1
      detect.py
  2. +1
    -1
      test.py

+ 1
- 1
detect.py ファイルの表示

@@ -18,7 +18,7 @@ def detect(save_img=False):

# Load model
google_utils.attempt_download(weights)
model = torch.load(weights, map_location=device)['model']
model = torch.load(weights, map_location=device)['model'].float() # load to FP32
# torch.save(torch.load(weights, map_location=device), weights) # update model if SourceChangeWarning
# model.fuse()
model.to(device).eval()

+ 1
- 1
test.py ファイルの表示

@@ -32,7 +32,7 @@ def test(data,

# Load model
google_utils.attempt_download(weights)
model = torch.load(weights, map_location=device)['model']
model = torch.load(weights, map_location=device)['model'].float() # load to FP32
torch_utils.model_info(model)
# model.fuse()
model.to(device)

読み込み中…
キャンセル
保存