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

RuntimeError: CUDA error: no kernel image is available for execution on the device #67

Open
watertianyi opened this issue Feb 25, 2023 · 0 comments

Comments

@watertianyi
Copy link

watertianyi commented Feb 25, 2023

Python 3.6.13 |Anaconda, Inc.| (default, Jun 4 2021, 14:25:59)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import torch
torch.cuda.is_available()
True
torch.cuda.device_count()
1
torch.cuda.get_device_name(0)
'NVIDIA GeForce RTX 3060'
torch.tensor([1.0, 2.0]).cuda()
tensor([1., 2.], device='cuda:0')
上述是安装的cuda11.0+pytorch1.7.1的,采用GPU报上述错误,怎么回事呢
Traceback (most recent call last):
File "style_transfer.py", line 113, in
img_rec, instyle = encoder(F.adaptive_avg_pool2d(I, 256), randomize_noise=False, return_latents=True, z_plus_latent=True, return_z_plus_latent=True, resize=False)
File "/home/hjq/anaconda3/envs/dual/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/media/hjq/EC3C5BDA3C5B9E80/win10/hjq_code/style_transfer/DualStyleGAN/model/encoder/psp.py", line 97, in forward
images, result_latent = self.decoder([codes],
File "/home/hjq/anaconda3/envs/dual/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in call_impl
result = self.forward(*input, **kwargs)
File "/media/hjq/EC3C5BDA3C5B9E80/win10/hjq_code/style_transfer/DualStyleGAN/model/stylegan/model.py", line 521, in forward
style
.append(self.style(s[:,i]).unsqueeze(1))
File "/home/hjq/anaconda3/envs/dual/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/hjq/anaconda3/envs/dual/lib/python3.8/site-packages/torch/nn/modules/container.py", line 117, in forward
input = module(input)
File "/home/hjq/anaconda3/envs/dual/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/media/hjq/EC3C5BDA3C5B9E80/win10/hjq_code/style_transfer/DualStyleGAN/model/stylegan/model.py", line 152, in forward
out = F.linear(input, self.weight * self.scale)
RuntimeError: CUDA error: no kernel image is available for execution on the device
Segmentation fault (core dumped)

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