module 'torch.cuda' has no attribute 'is_avaliable'
时间: 2023-09-21 11:03:23 浏览: 210
torch.cuda.is_available()返回False解决方案
5星 · 资源好评率100%
The correct attribute name is `torch.cuda.is_available()`.
You can use this attribute to check if the CUDA is available on your system or not. This attribute returns a Boolean value indicating whether CUDA is currently available or not.
Here's an example:
```
import torch
if torch.cuda.is_available():
print("CUDA is available on this system.")
else:
print("CUDA is not available on this system.")
```
阅读全文