问题:

     安装好  torch-1.1.0-cp36-cp36m-win_amd64.whl后提示torch.nn.TransformerEncoderLayer 不能用

     提示错误为:'torch.nn' has no attribute 'TransformerEncoderLayer'

解决方法: 

     安装Torch包1.2 进行解决

解决方案来源:

1.PyTorch中Transformer模型的使用 

https://www.jianshu.com/p/23b527e0f696

2.Pytorch1.2 cpu版本安装教程(附加GPU下载)

 安装好 torch-1.1.0-cp36-cp36m-win_amd64.whl后提示torch.nn.TransformerEncoderLayer 不能用

https://blog.csdn.net/qq_41375318/article/details/102483339

3.使用Pip安装时速度慢或是下载不下来时直接在官网下载到本地进行安装

https://download.pytorch.org/whl/torch_stable.html 页面如下

安装好 torch-1.1.0-cp36-cp36m-win_amd64.whl后提示torch.nn.TransformerEncoderLayer 不能用

4. 安装:

pip install 下载的文件路径名称 

 

相关文章:

  • 2022-03-06
  • 2021-06-03
  • 2021-06-06
  • 2021-05-10
  • 2022-12-23
  • 2021-09-01
  • 2021-07-07
  • 2022-01-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
  • 2022-01-15
  • 2022-02-06
  • 2022-12-23
  • 2021-08-09
相关资源
相似解决方案