我在这里问一些关于 Pytorch 和卷积自动编码器的更一般的问题。
顺便说一句,我想制作一个对称的卷积自动编码器来对不同图像大小的黑白图像进行着色。
self.encoder = nn.Sequential (
# conv 1
nn.Conv2d(in_channels=3, out_channels=512, kernel_size=3, stride=1, padding=1),
nn.ReLU,
nn.MaxPool2d(kernel_size=2, stride=2), # 1/2
nn.BatchNorm2d(512),
# conv 2
nn.Conv2d(in_channels=512, out_channels=256, kernel_size=3, stride=1, padding=1),
nn.ReLU,
nn.MaxPool2d(kernel_size=2, stride=2), # 1/4
nn.BatchNorm2d(256),
# conv 3
nn.Conv2d(in_channels=256, out_channels=128, kernel_size=3, stride=1, padding=1),
nn.ReLU,
nn.MaxPool2d(kernel_size=2, stride=2), # 1/8
nn.BatchNorm2d(128),
# conv 4
nn.Conv2d(in_channels=128, out_channels=64, kernel_size=3, stride=1, padding=1),
nn.ReLU,
nn.MaxPool2d(kernel_size=2, stride=2), #1/16
nn.BatchNorm2d(64)
)
self.encoder = nn.Sequential (
# conv 5
nn.ConvTranspose2d(in_channels=64, out_channels=128, kernel_size=3, stride=1, …
Run Code Online (Sandbox Code Playgroud) machine-learning computer-vision neural-network deep-learning pytorch
我遇到过许多用于分类问题的神经网络架构。AlexNet、ResNet、VGGNet、GoogLeNet 等......是否有类似的回归问题网络可用于迁移学习?
artificial-intelligence neural-network conv-neural-network keras pytorch
我尝试使用命令“conda install cudatoolkit = 11.7”安装cudatoolkit 11.7,但失败了。但是,网站https://pytorch.org/get-started/locally/显示 11.7 可用。我该怎么办才能解决它?谢谢
我是pytorch的新手.我从这个存储库中获取了代码https://github.com/ruotianluo/ImageCaptioning.pytorch,并希望为图像制作标题.安装"CUDA",当我运行脚本来创建注释时,会产生以下结果:
$ CUDA_LAUNCH_BLOCKING = 1条蟒蛇eval.py --model model.pth - -infos_path infos.pkl --image_folder等等--num_images 1 /home/azat/anaconda2/lib/python2.7/site-packages/h5py/ 初始化的.py :36:FutureWarning:不推荐将issubdtype的第二个参数从
float
to 转换为np.floating
.在将来,它将被视为np.float64 == np.dtype (float) .type
.从进口._conv作为register_converters _register_converters /home/azat/anaconda2/lib/python2.7/site-packages/torch/cuda/ INIT的.py:97:UserWarning:实测值GPU0的GeForce 820M是CUDA能力2.1.PyTorch不再支持这款GPU,因为它太旧了.warnings.warn(old_gpu_warn%(d,name,major,capability 1))DataLoaderRaw从文件夹加载图片:blah 0列出目录中的所有图像blah DataLoaderRaw找到8张图片THCudaCheck FAIL文件=/pytorch/torch/lib/THC/generic/THCTensorMathPairwise.cu line = 40 error = 48:没有内核映像可用于设备Traceback(最近一次最后一次调用):文件"eval.py",第122行,在vars(opt)中文件"/ home/azat/Programing/Python/techno_atom_neuro/Others Implementation/ImageCaptioning.pytorch-master/eval_utils.py",第82行,在eval_split中data = loader.get_batch(split)文件"/ home/azat/Programing/Python/techno_atom_neuro/Others实现/ ImageCaptioning.pytorch-master/dataloaderraw.py",第112行,在get_batch img = Variable(preprocess(img),volatile = True)文件"/home/azat/anaconda2/lib/python2.7/site-packages/torchvision /transforms/transforms.py",第42行,在调用 img = t(img)文件"/home/azat/anaconda2/lib/python2.7/ site-packages/torchvision/transforms/transforms.py",第118行,在调用 返回F.normalize(tensor,self.mean,self.std)文件"/home/azat/anaconda2/lib/python2.7/site- packages/torchvision/transforms/functional.py",第161行,标准化t.sub_(m).div_(s)RuntimeError:cuda运行时错误(48):没有内核映像可以在/ pytorch /上的设备上执行火炬/ lib目录/ THC /通用/ THCTensorMathPairwise.cu:40
所以,我想知道这个错误是什么,硬件或软件.我该如何解决这个问题呢.谢谢.
PyTorch
OS: Ubuntu 16.04
PyTorch version: 0.3.1 pip …
Run Code Online (Sandbox Code Playgroud) 错误消息如下:
RuntimeError Traceback (most recent call last)
<ipython-input-24-06e96beb03a5> in <module>()
11
12 x_test = np.array(test_features)
---> 13 x_test_cuda = torch.tensor(x_test, dtype=torch.float).cuda()
14 test = torch.utils.data.TensorDataset(x_test_cuda)
15 test_loader = torch.utils.data.DataLoader(test, batch_size=batch_size, shuffle=False)
/usr/local/lib/python3.6/dist-packages/torch/cuda/__init__.py in _lazy_init()
160 class CudaError(RuntimeError):
161 def __init__(self, code):
--> 162 msg = cudart().cudaGetErrorString(code).decode('utf-8')
163 super(CudaError, self).__init__('{0} ({1})'.format(msg, code))
164
RuntimeError: cuda runtime error (38) : no CUDA-capable device is detected at /pytorch/aten/src/THC/THCGeneral.cpp:51
Run Code Online (Sandbox Code Playgroud) 当我尝试运行pip3 install pytorch
或pip install pytorch
Collecting pytorch
Using cached pytorch-1.0.2.tar.gz (689 bytes)
Building wheels for collected packages: pytorch
Building wheel for pytorch (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/chaitanya/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3v4wd97t/pytorch/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3v4wd97t/pytorch/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-8rsdyb8e
cwd: /tmp/pip-install-3v4wd97t/pytorch/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-3v4wd97t/pytorch/setup.py", line 15, in <module>
raise …
Run Code Online (Sandbox Code Playgroud)