Skip to content

Error in train.py #147

Open
Open

Description

@Daisytmzkae

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

Activity

  1. AlinawazHusain commented on Dec 29, 2023

    @AlinawazHusain

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions