pytorch笔记
参考资料
文档
https://github.com/jcjohnson/pytorch-examples
https://pytorch.org/docs/stable/index.html
(pytorch中文官方文档)https://pytorch-cn.readthedocs.io/zh/latest/package_references/torch-optim/
视频
一些坑
1、加载Mnist数据集的坑
print("下载训练集中...")
train_set = torchvision.datasets.MNIST(".\data", train=True, download=True, transform=pipeline)
print("下载测试集中...")
test_set = torchvision.datasets.MNIST(".\data", train=False, download=True, transform=pipeline)

UserWarning: The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:180.)
return torch.from_numpy(parsed.astype(m[2], copy=False)).view(*s)
解决方法:直接定位到错误的地方,删掉, copy=False,就正常了


2、
本文来自博客园,作者:JaxonYe,转载请注明原文链接:https://www.cnblogs.com/yechangxin/articles/16614517.html
侵权必究

浙公网安备 33010602011771号