pytorch=2.2.2报torch.nn.attention是由于2.2.2版本还没有nn.attention的功能,需要安装torch<=2.4.1。
本人想偷个懒,在github找到pytorch的源码,将nn目录下的attention目录,拷贝到已有的pytorch安装包目录下。完美解决在pytorch=2.2.2找不到torch.nn.attention模块。
ValueError: f must be a string filename in order to use mmap argument错误,将mmap设置成False
weights = torch.load(
^^^^^^

最低0.47元/天 解锁文章
1873

被折叠的 条评论
为什么被折叠?



