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

How do I fix this? #67

Closed
spladder opened this issue Jul 25, 2017 · 10 comments
Closed

How do I fix this? #67

spladder opened this issue Jul 25, 2017 · 10 comments

Comments

@spladder
Copy link

I am running this on a Mid 2011 IMac OSX 10.10, and so far everything has run smoothly. I am at this step in the instructions:
python train.py --dataroot ./datasets/maps --name maps_cyclegan --model cycle_gan --no_dropout

And I get this as a result:
Traceback (most recent call last):
File "train.py", line 7, in
opt = TrainOptions().parse()
File "/Users/samuellevin/vision/pytorch-CycleGAN-and-pix2pix/options/base_options.py", line 60, in parse
torch.cuda.set_device(self.opt.gpu_ids[0])
File "/Users/samuellevin/anaconda3/lib/python3.6/site-packages/torch/cuda/init.py", line 161, in set_device
torch._C._cuda_setDevice(device)
AttributeError: module 'torch._C' has no attribute '_cuda_setDevice'

How do I fix this?

@junyanz
Copy link
Owner

junyanz commented Jul 29, 2017

I wonder if you have installed the Pytorch with CUDA support. What's the GPU in your iMac?

@codytodonnell
Copy link

Try running on CPU by adding the following option: --gpu_ids -1

@junyanz junyanz closed this as completed Nov 24, 2017
@rchavezj
Copy link

rchavezj commented Jun 2, 2018

"--gpu_ids -1" doesn't work on mac sadly...

I tried --gpu -1 but I still get the same error.

@vin-ni
Copy link

vin-ni commented Sep 12, 2018

any news on this?

@pietruh
Copy link

pietruh commented Oct 11, 2018

Changing the line to:
torch._C._cuda_setDevice(-1)
worked for me.

@ZangChaoyu
Copy link

请问在windows中怎样解决AttributeError: module 'torch._C' has no attribute '_cuda_setDevice'

@ghost
Copy link

ghost commented Oct 10, 2020

cuda error
Hey guys!
I am using windows 10 with only CPU and getting the error mentioned in the screenshot.
How to fix it?
Thank you.

@junyanz
Copy link
Owner

junyanz commented Oct 10, 2020

Not sure. It seems to be related to PyTorch. You could post/find the issue on the PyTorch repo.

@ghost
Copy link

ghost commented Oct 10, 2020

Thank you so much for your suggestion let me go through on pytorch repo.

@QasimWani
Copy link

cuda error
Hey guys!
I am using windows 10 with only CPU and getting the error mentioned in the screenshot.
How to fix it?
Thank you.

hey!
were u able to figure out what the problem you had was?

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

8 participants