To train my model using less GPU memory, I tried to use the “amp” package. However,an error occurred when importing this package, which is:
"ModuleNotFoundError: No module named 'torch.cuda.amp.autocast'".
My pytorch verision is 1.8.1, and the codes for importting the package are written as:
import torch.cuda.amp.autocast
import torch.cuda.amp.GradScaler
I wonder why this error occurred, and how to solve it. Thanks