Sad*_*yan 6 conv-neural-network pytorch
我正在下面训练一个卷积神经网络。
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,
)
Run Code Online (Sandbox Code Playgroud)
警告中只有另一件事是
返回 F.conv2d(输入, 权重, 偏差, self.stride,
我不知道这个警告是什么以及我能做什么。如果需要有关系统的任何信息,我可以编辑问题并添加到其中。
小智 14
这似乎是 CUDA 库的问题pytorch 2.0.x+cu118。有几个可能的修复方法。
pip3 uninstall pytorch
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117)
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
或者,您应该能够忽略该警告;它不应该有任何副作用或影响。
我在这个 GitHub 问题中找到了上述解决方案,以及对该问题的更深入的讨论。
| 归档时间: |
|
| 查看次数: |
6533 次 |
| 最近记录: |