![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytorch
小孟Tec
为什么我的眼里常含泪水?
因为我对这土地爱得深沉……
展开
-
linux下配置服务器端jupyter,本地访问&在jupyter中添加conda虚拟环境
文章目录0. 背景1. 安装jupyter notebook2. 生成配置文件3. 设置登陆密码并生成秘钥4. 修改配置文件5. 在服务器生成jupyter访问地址Reference0. 背景实验室服务器没有图形界面,只能通过ssh 登录访问,但是炼丹过程中涉及很多脚本,想体验交互式的过程。查了下可以配置服务器端的jupyter,然后用本地浏览器远程访问。1. 安装jupyter notebookpip install jupyter2. 生成配置文件jupyter notebook --ge原创 2020-05-27 12:38:31 · 573 阅读 · 0 评论 -
解决torch.cuda.is_available()为False的一种方法
文章目录卡的版本和驱动如下1.5.0版本的torch 无法识别卡当时就很困惑,昨天在另外的一个环境里面还可以识别。卡的版本和驱动如下1.5.0版本的torch 无法识别卡当时就很困惑,昨天在另外的一个环境里面还可以识别。解决方法:可以升级显卡版本和驱动将torch降到低版本的...原创 2020-05-23 16:01:55 · 11599 阅读 · 0 评论 -
查看GPU信息 | python -m参数
文章目录torch 查看GPUnvidia-smi 详解torch 查看GPUtorch.cuda.is_available() # cuda是否可用;torch.cuda.device_count() # 返回gpu数量;torch.cuda.get_device_name(0) # 返回gpu名字,设备索引默认从0开始;torch.cuda.current_device() # 返回当前设备索引;reference:https://pytorch.org/docs/stabl原创 2020-05-19 00:22:06 · 3668 阅读 · 0 评论 -
torch.nn.Linear()函数的理解
import torchx = torch.randn(128, 20) # 输入的维度是(128,20)m = torch.nn.Linear(20, 30) # 20,30是指维度output = m(x)print('m.weight.shape:\n ', m.weight.shape)print('m.bias.shape:\n', m.bias.shape)print...原创 2019-12-23 13:49:08 · 894 阅读 · 0 评论 -
Anaconda清华镜像源的使用&&安装Pytorch失败的问题
reference:https://blog.csdn.net/WannaSeaU/article/details/88427010原创 2019-11-20 16:39:34 · 925 阅读 · 0 评论 -
PyTorch Note -- 自动求导
自动求导有两种方式 torch.autograd.grad(loss_func, [parameter, ...]) 或者是 loss_func.backward() ; parameter.gradx = torch.ones(1)# print(x)w = torch.full([1], 2, requires_grad=True)# print(w) # tensor([2....原创 2019-10-23 21:18:42 · 148 阅读 · 0 评论 -
PyTorch Note -- 合并与分割、数学运算、属性统计
stack 会创建新的维度矩阵乘法统计属性where用法设计where的初衷:如果采用循环控制语句for i in range(k),for j in range(m)等,这种方法是不能用GPU来加速的。所以设计了where方法,condition矩阵可以用cpu的方式或者gpu的方式生成,...原创 2019-10-23 01:52:11 · 111 阅读 · 0 评论 -
PyTorch Note
PyTorch没有string对应的表示类型(内键支持),但对于文本类型的序列数据,可以用ont-hot 或者 embedding的方式来表示:数据在CPU上和在GPU上的类型是不同的:dimension为0 :标量 -- 用来表示Lossimport torcha = torch.ones(3)print(a) # tensor([1., 1.,...原创 2019-10-22 12:42:50 · 110 阅读 · 0 评论 -
Torch笔记
Torch 中的Cross_Entropy 是和 softmax 绑定在一起的,以确保数值稳定性防止overfitting手动实现1范数的 Regularization2范数 torch 已经封装在模型中了动量法 MomentumLearning rate decay 的两种方法Batch Norm...原创 2019-06-30 12:45:43 · 133 阅读 · 0 评论