DirectML is a high-performance, hardware-accelerated DirectX 12 library for machine learning. DirectML provides GPU acceleration for common machine learning tasks across a broad range of supported hardware and drivers, including all DirectX 12-capable GPUs from vendors such as AMD, Intel, NVIDIA, and Qualcomm.
MIT License
2.18k
stars
289
forks
source link
torch-directml : ImportError: cannot import name 'autocast' from 'torch.amp' (unknown location) #648
File ~\AppData\Roaming\Python\Python312\site-packages\torch__init__.py:1686
1683 raise RuntimeError("Unable to find torch_shm_manager at " + path)
1684 return path.encode('utf-8')
-> 1686 from torch.amp import autocast, GradScaler
1688 # Initializing the extension shadows the built-in python float / int classes;
1689 # store them for later use by SymInt / SymFloat.
1690 py_float = float
ImportError: cannot import name 'autocast' from 'torch.amp' (unknown location)
pip install torch-directml
torch==2.4.1 torch-directml==0.2.5.dev240914 torchvision==0.19.1
In [1]: import torch
ImportError Traceback (most recent call last) Cell In[1], line 1 ----> 1 import torch
File ~\AppData\Roaming\Python\Python312\site-packages\torch__init__.py:1686 1683 raise RuntimeError("Unable to find torch_shm_manager at " + path) 1684 return path.encode('utf-8') -> 1686 from torch.amp import autocast, GradScaler 1688 # Initializing the extension shadows the built-in python float / int classes; 1689 # store them for later use by SymInt / SymFloat. 1690 py_float = float
ImportError: cannot import name 'autocast' from 'torch.amp' (unknown location)