Update P5 + P6 model ensembling (#3082)

This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-05-08 19:06:12 +02:00
1 parent d2a17289c9
commit 251aeafcb1
1 file changed
+3 -2
+3 -2
View File
@@ -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