apex icon indicating copy to clipboard operation
apex copied to clipboard

pytorch 1.8 dont have the func "get_autocast_gpu_dtype()"

Open ryanyanhao opened this issue 4 years ago • 5 comments

File "/usr/local/lib/python3.7/dist-packages/apex/_autocast_utils.py", line 17, in _cast_if_autocast_enabled return torch.cuda.amp.autocast_mode._cast(args, torch.get_autocast_gpu_dtype())

AttributeError: module 'torch' has no attribute 'get_autocast_gpu_dtype'

ryanyanhao avatar Dec 02 '21 07:12 ryanyanhao

Did you solve it? The same error came out.

k007ke avatar Feb 17 '22 08:02 k007ke

use torch.cuda.amp

ryanyanhao avatar Feb 17 '22 08:02 ryanyanhao

image

It's the torch version 1.9, but it can't be solved. What's the reason?

k007ke avatar Feb 17 '22 09:02 k007ke

Dose anyone solve it? I encounter the same error with torch-1.9.0.

jianghaojun avatar Apr 05 '22 12:04 jianghaojun

Dose anyone solve it? I encounter the same error with torch-1.9.0.

Update to torch-1.11 can solve this problem. torch-1.8 torch-1.9.0 do not have this function.

Youggls avatar May 01 '22 05:05 Youggls