Skip to content

Commit

Permalink
Update P5 + P6 model ensembling (#3082)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed May 8, 2021
1 parent d2a1728 commit 251aeaf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions models/experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def attempt_load(weights, map_location=None, inplace=True):
if len(model) == 1:
return model[-1] # return model
else:
print('Ensemble created with %s\n' % weights)
for k in ['names', 'stride']:
print(f'Ensemble created with {weights}\n')
for k in ['names']:
setattr(model, k, getattr(model[-1], k))
model.stride = model[torch.argmax(torch.tensor([m.stride.max() for m in model])).int()].stride # max stride
return model # return ensemble

0 comments on commit 251aeaf

Please sign in to comment.