amp import error #1875
-
Hi, all When I run the maisi_train_vae_tutorial.ipynb file, I encounter the following issue. ImportError: cannot import name 'GradScaler' from 'torch.amp' (/home/shengzhang/miniconda3/envs/maisi/lib/python3.10/site-packages/torch/amp/init.py) I have executed the following command "conda install -c conda-forge nvidia-apex", but it does not work. Thanks a lot. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @shengzhang90, may I know your torch version. |
Beta Was this translation helpful? Give feedback.
GradScaler
moved under torch.amp after torch 2.3.0. Could you please try upgrade your PyTorch version or you can simply usetorch.cuda.amp.GradScaler
?https://github.com/pytorch/pytorch/tree/v2.3.0/torch/amp
Thanks.