pytorch
math_computer
一个热爱数学和雨点的嗯,还没想好是什么
展开
-
pip升级后不能查看版本,不能安装包
1.问题:把pip2通过 sudo pip2 install --upgrade pip升级为18.1后,查看版本pip2 -V,显示Traceback (most recent call last): File "/usr/bin/pip2", line 9, in <module> from pip import mainImportError: cannot...原创 2018-10-20 10:48:29 · 967 阅读 · 0 评论 -
pip2安装matplotlib, scikit-image
1. 问题:pip2 install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple,显示 Matplotlib 3.0+ does not support Python 2.x, 3.0, 3.1, 3.2, 3.3, or 3.4. Beginning with Matplotlib 3.0, Python 3...原创 2018-10-20 11:12:51 · 4432 阅读 · 1 评论 -
nvidia-smi指令解析和cpu/gpu资源监控
1. nvidia-smi指令解析:https://blog.csdn.net/qq_25819827/article/details/789773252. 资源监控:watch -n 1 nvidia-smihttps://blog.csdn.net/zong596568821xp/article/details/80268034?utm_source=blogxgwz3...原创 2018-10-20 14:11:24 · 1002 阅读 · 0 评论 -
增加交换分区
参见Ubuntu 16.04扩展swap分区,在ubuntu18.0上实测有效。从原来的2.0G扩充为7.0G同样的操作可以再次使用:原创 2018-10-20 18:52:10 · 653 阅读 · 0 评论 -
RuntimeError: CUDA error: device-side assert triggered
pytorch中运行分类或者多类分割任务时,报错:/pytorch/aten/src/THCUNN/SpatialClassNLLCriterion.cu:103: void cunn_SpatialClassNLLCriterion_updateOutput_kernel(T *, T *, T *, long *, T *, int, int, int, int, int, long) [...原创 2019-07-03 16:55:44 · 13954 阅读 · 22 评论 -
RuntimeError: expected backend CPU and dtype Float but got backend CUDA and dtype Float
这种问题,就是数据没有放进gpu造成的,一般加.cuda()可以解决原创 2019-07-17 16:57:38 · 13051 阅读 · 4 评论 -
torchvision.transforms.ToTensor的细节
查看文档https://pytorch.org/docs/stable/torchvision/transforms.html的源码[docs]class ToTensor(object): """Convert a ``PIL Image`` or ``numpy.ndarray`` to tensor. Converts a PIL Image or numpy.ndarray (H x ...原创 2019-08-21 14:29:16 · 866 阅读 · 0 评论 -
Pytorch之torchvision.models的resnet34模型源码
源码地址:https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py注意torchvision版本,之前的版本如0.2.0中,self.avgpool=nn.AvgPool2d(7, stride=1),这样的话输入就限定为224*224了,但是版本0.4.0中,就是self.avgpool=nn.Ada...原创 2019-08-22 16:23:28 · 3417 阅读 · 0 评论