pytorch1.4 报错error in LoadLibraryA
- pytorch error in LoadLibraryA报错处理
- 例
- 报错
- 解决
- 原因
pytorch error in LoadLibraryA报错处理
例
1 2 3 4 5 | import torch a: torch.Tensor = torch.arange(9).view(3, 3).cuda() # 下列运算都不能执行 torch.cat([a, a]) torch.stack([a, a]) |
报错
RuntimeError: error in LoadLibraryA

解决
根据stackoverflow,解决方案:

原因
pytorch1.4版本在某些情况下会出现这个情况,将在1.5解决则个bug
1 2 3 4 5 6 7 8 | import torch import ctypes # 引入caffe2_nvrtc库,问题解决 ctypes.cdll.LoadLibrary('caffe2_nvrtc.dll') a: torch.Tensor = torch.arange(9).view(3, 3).cuda() torch.cat([a, a]) torch.stack([a, a]) |

