Skip to content

Commit

Permalink
update gen_wts.py
Browse files Browse the repository at this point in the history
  • Loading branch information
WuxinrongY authored Mar 25, 2024
1 parent f12bbe0 commit 2af91df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yolov9/gen_wts.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def parse_args():
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
Expand Down Expand Up @@ -67,4 +67,4 @@ def parse_args():
for k, v in model.state_dict().items():
vr = v.reshape(-1).cpu().numpy()
f.write('{} {} '.format(k, len(vr)))
f.write('\n')
f.write('\n')

0 comments on commit 2af91df

Please sign in to comment.