intersect_dicts() in hubconf.py fix (#5542)

This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-11-06 15:41:17 +01:00
1 parent fa2344cdd8
commit e189fa15ea
4 files changed
+10 -12

No files matched your search

-5
View File
@@ -153,11 +153,6 @@ def de_parallel(model):
return model.module if is_parallel(model) else model
def intersect_dicts(da, db, exclude=()):
# Dictionary intersection of matching keys and shapes, omitting 'exclude' keys, using da values
return {k: v for k, v in da.items() if k in db and not any(x in k for x in exclude) and v.shape == db[k].shape}
def initialize_weights(model):
for m in model.modules():
t = type(m)