英文:
UserWarning: Applied workaround for CuDNN issue, install nvrtc.so
问题
I'm translating the code for you:
我正在训练一个卷积神经网络,如下所示:
def __init__(self, n_channels, n_classes):
super().__init__()
self.model = models.mobilenet_v3_large(pretrained=True)
self.model.classifier[-1] = nn.Linear(1280, n_classes)
self.model.features[0][0] = nn.Conv2d(
n_channels,
16,
kernel_size=(3, 3),
stride=(2, 2),
padding=(1, 1),
bias=False,
)
关于警告的内容如下:
只有警告信息中还有另一件事:
> return F.conv2d(input, weight, bias, self.stride,
我不知道这个警告是什么,以及我该怎么处理它。如果需要有关系统的任何信息,请告诉我,我可以编辑问题并添加它。
希望这有助于您理解代码和警告。
英文:
I'm trainning a convolutional nueral network below.
def __init__(self, n_channels, n_classes):
super().__init__()
self.model = models.mobilenet_v3_large(pretrained=True)
self.model.classifier[-1] = nn.Linear(1280, n_classes)
self.model.features[0][0] = nn.Conv2d(
n_channels,
16,
kernel_size=(3, 3),
stride=(2, 2),
padding=(1, 1),
bias=False,
)
there is only another thing in the warning that is
> return F.conv2d(input, weight, bias, self.stride,
I don't know what is this warning and what can i do for it. if any information about the system is required, i can edit the question and add to it.
答案1
得分: 9
这似乎是与pytorch 2.0.x+cu118
中的CUDA库有关的问题。有几种可能的修复方法。
- 降级到先前的CUDA库,cu117。例如,使用pip:
pip3 uninstall pytorch
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117)
- 如果要继续使用cu118,请在torch包库中创建一个符号链接。
cd venv/python3.10/site-packages/torch/lib # (或者根据您安装pytorch的方式,可能是dist-packages/torch/lib的路径)
ln -s libnvrtc-*.so.11.2 libnvrtc.so
或者,您应该能够忽略此警告;它不应该产生任何副作用或影响。
我在此GitHub问题中找到了上述解决方案,以及对该问题的更深入讨论。
英文:
This seems to be an issue with the CUDA library in pytorch 2.0.x+cu118
. There're a couple of possible fixes.
- Downgrade to the previous CUDA library, cu117. E.g. with pip:
pip3 uninstall pytorch
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117)
- To continue to use cu118, create a symlink in the torch package library.
cd venv/python3.10/site-packages/torch/lib # (or the path to dist-packages/torch/lib, depending on how you installed pytorch)
ln -s libnvrtc-*.so.11.2 libnvrtc.so
Alternatively, you should be able to ignore the warning; it shouldn't have any side effects or impact.
I found the above solutions in this GitHub issue, along with more in-depth discussions into the issue.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论