Can‘t get attribute ‘SiLU‘ on <module ‘torch.nn.modules.activation

Can't get attribute 'SiLU' on <module 'torch.nn.modules.activation

报错代码:

aaa=torch.load(w, map_location=map_location)['model'].float().fuse().eval()

原因:

torch加载的时候,会自动映射到类里面

临时解决方法:

把类SiLU的代码粘贴到activation文件中。

猜你喜欢

转载自blog.csdn.net/jacke121/article/details/115047893
今日推荐