【问题解决】AttributeError: module ‘timm.optim.optim_factory‘ has no attribute ‘add_weight_decay‘
·
MAE运行时,报错问题
AttributeError: module 'timm.optim.optim_factory' has no attribute 'add_weight_decay'
有人说是timm版本不够新 但更新最新版本并不能解决这个问题。
实际应该是版本过高了。
所以需要先卸载timm,然后换0.5.4版本的timm,即可解决:
pip uninstall timm
pip install timm==0.5.4
也有说可以改下code即可,这个我没有尝试
optimizer = torch.optim.AdamW(model_without_ddp.parameters(), lr=args.lr, betas=(0.9, 0.95),weight_decay=args.weight_decay)
更多推荐

所有评论(0)