update gen_wts.py (#1467)

This commit is contained in:
WuxinrongY 2024-03-26 13:30:00 +08:00 committed by GitHub
parent f12bbe0359
commit 551be9d939
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,7 +32,7 @@ print(f'Generating .wts for {m_type} model')
print(f'Loading {pt_file}')
device = select_device('cpu')
model = torch.load(pt_file, map_location=device) # Load FP32 weights
model.model.float()
model = model["model"].float()
if m_type in ['detect', 'seg']:
# update anchor_grid info