Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Torch not compiled with CUDA enabled #28

Open
ethio-artifical opened this issue Mar 7, 2023 · 2 comments
Open

Torch not compiled with CUDA enabled #28

ethio-artifical opened this issue Mar 7, 2023 · 2 comments

Comments

@ethio-artifical
Copy link

ethio-artifical commented Mar 7, 2023

hello, how are guys

i try this code but my machine don't have GPU service enabled
So, please give me the solution how to try with out CUDA

the error is :

File "F:\code\VAC_CSLR-main\main.py", line 209, in
processor = Processor(args)
File "F:\code\VAC_CSLR-main\main.py", line 34, in init
self.model, self.optimizer = self.loading()
File "C:\Users\ANTENEH\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\cuda_init_.py", line 221, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

this is the error that
How Can I test in CPU???

@ycmin95
Copy link
Collaborator

ycmin95 commented Mar 8, 2023

@ethio-artifical
You just need to comment model.cuda() line in main.py, and modify the pre-trained load process in main.py to
state_dict = torch.load(weight_path, map_location=torch.device('cpu')).

The command to evaluate the pre-trained model on CPU is:
python main.py --load-weights resnet18_slr_pretrained.pt --phase test --device None

@ethio-artifical
Copy link
Author

ethio-artifical commented Mar 10, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants