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

Can I execute it with only run.py file #10

Open
samTheHacke opened this issue May 18, 2021 · 7 comments
Open

Can I execute it with only run.py file #10

samTheHacke opened this issue May 18, 2021 · 7 comments

Comments

@samTheHacke
Copy link

Can anyone explain why we are using twopass.py and utils.py? Can't we run this only with code of run.py
And I am getting error while executing run.py at line of Canvas_mask =numpy2tensor(canvas_mask,gpu_id)
Please help me bros
16213573728603563816958091638982

@alvarogonjim
Copy link

Basically you have installed torch without CUDA maybe because you do not have a GPU.
Either you reinstall torch with CUDA or you change the code to run in CPU.

@samTheHacke
Copy link
Author

Basically you have installed torch without CUDA maybe because you do not have a GPU.
Either you reinstall torch with CUDA or you change the code to run in CPU.

Thank you sooo much brother,can I known how to change code to run on cpu

@alvarogonjim
Copy link

You have to change the variable gpu_id in the code to 'cpu'.
Here an easy example so you can understand:

#To GPU with the device number 0
tensor = torch.randn(2, 2).to('cuda:0') 
# To CPU
tensor = torch.randn(2,2).to('cpu') 

You can read more:
https://pytorch.org/docs/master/generated/torch.Tensor.to.html

@samTheHacke
Copy link
Author

You have to change the variable gpu_id in the code to 'cpu'.
Here an easy example so you can understand:

#To GPU with the device number 0
tensor = torch.randn(2, 2).to('cuda:0') 
# To CPU
tensor = torch.randn(2,2).to('cpu') 

You can read more:
https://pytorch.org/docs/master/generated/torch.Tensor.to.html

IMG20210520225546_00.jpg

@samTheHacke
Copy link
Author

You have to change the variable gpu_id in the code to 'cpu'.
Here an easy example so you can understand:

#To GPU with the device number 0
tensor = torch.randn(2, 2).to('cuda:0') 
# To CPU
tensor = torch.randn(2,2).to('cpu') 

You can read more:
https://pytorch.org/docs/master/generated/torch.Tensor.to.html

Sir even after replacing from GPU to cpu I am getting errors sir

@alvarogonjim
Copy link

@samTheHacke The error says that could not found NVIDIA Driver which means that still the code is checking for GPU instead of CPU. Did you install the CPU version of Torch?
From https://pytorch.org/get-started/locally/

pip3 install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html

@samTheHacke
Copy link
Author

@samTheHacke The error says that could not found NVIDIA Driver which means that still the code is checking for GPU instead of CPU. Did you install the CPU version of Torch?
From https://pytorch.org/get-started/locally/

pip3 install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html

No I don't have cuda supported GPU,so I want code to execute to cpu ,but as you said I changed every gpu_id to cpu but I am getting soo many errors .
if I want to execute this project in cpu what things I have to change in this code.

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