Machine-Learning-Collection icon indicating copy to clipboard operation
Machine-Learning-Collection copied to clipboard

Error in train.py

Open Daisytmzkae opened this issue 2 years ago • 1 comments

C:\Users\hp\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\cuda\amp\grad_scaler.py:118: UserWarning: torch.cuda.amp.GradScaler is enabled, but CUDA is not available. Disabling. warnings.warn("torch.cuda.amp.GradScaler is enabled, but CUDA is not available. Disabling.") 0%| | 0/9 [01:03<?, ?it/s] Traceback (most recent call last): File "c:\Users\hp\VSCode projcts\trainunet.py", line 143, in main() File "c:\Users\hp\VSCode projcts\trainunet.py", line 120, in main train_fn(train_loader, model,optimizer,loss_fn, scaler) File "c:\Users\hp\VSCode projcts\trainunet.py", line 39, in train_fn with torch.cuda.amp.autocast_mode(): TypeError: 'module' object is not callable

Daisytmzkae avatar Mar 24 '23 07:03 Daisytmzkae

@Daisytmzkae it seems like CUDA is not available in your device . you should train on GPU for this function not CPU

AlinawazHusain avatar Dec 29 '23 13:12 AlinawazHusain