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

gpu改成CPU出错了 #2

Open
19chang19 opened this issue Feb 1, 2020 · 0 comments
Open

gpu改成CPU出错了 #2

19chang19 opened this issue Feb 1, 2020 · 0 comments

Comments

@19chang19
Copy link

Traceback (most recent call last):
File "train.py", line 85, in
input = Variable(input).cuda()
File "/root/anaconda3/envs/pytorch3712/lib/python3.7/site-packages/torch/cuda/init.py", line 178, in _lazy_init
_check_driver()
File "/root/anaconda3/envs/pytorch3712/lib/python3.7/site-packages/torch/cuda/init.py", line 92, in _check_driver
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

出现这个问题时,我瞎改了下
input = Variable(input).cpu() #.cuda()
target = Variable(torch.from_numpy(np.array(target)).long()).cpu() #.cuda()

再跑一遍出现下面的错了。。。。。。

Traceback (most recent call last):
File "train.py", line 87, in
output = model(input)
File "/root/anaconda3/envs/pytorch3712/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/root/mycode/myimage_class/Model.py", line 102, in forward
x = self.backbone.layer2(x)
File "/root/anaconda3/envs/pytorch3712/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/root/anaconda3/envs/pytorch3712/lib/python3.7/site-packages/torch/nn/modules/container.py", line 92, in forward
input = module(input)
File "/root/anaconda3/envs/pytorch3712/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/root/anaconda3/envs/pytorch3712/lib/python3.7/site-packages/torchvision/models/resnet.py", line 106, in forward
out = self.conv3(out)
File "/root/anaconda3/envs/pytorch3712/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/root/anaconda3/envs/pytorch3712/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 343, in forward
return self.conv2d_forward(input, self.weight)
File "/root/anaconda3/envs/pytorch3712/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 340, in conv2d_forward
self.padding, self.dilation, self.groups)
File "/root/anaconda3/envs/pytorch3712/lib/python3.7/site-packages/torch/utils/data/_utils/signal_handling.py", line 66, in handler
_error_if_any_worker_fails()
RuntimeError: DataLoader worker (pid 24624) is killed by signal: Killed.

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

1 participant