- 博客(6)
- 收藏
- 关注
转载 Deep Learning 最优化方法
链接:https://blog.csdn.net/BVL10101111/article/details/72615961
2018-06-21 09:23:17 295
原创 pytorch警告解决方案
安装的pytorch版本: 遇到的问题: 1.UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use tensor.item() to convert a 0-dim tensor to a Python number losses.update(loss.data[0...
2018-06-08 19:30:16 5828
原创 pytorch之numpy,tensor,variable转换
1.将numpy矩阵转换为Tensor张量locs= torch.from_numpy(loc) #loc为numpy类型 2.将Tensor张量转化为numpy矩阵locs1 = locs.numpy() 3.将numpy转换为Variablelocs2= Variable(torch.from_numpy(locs1)) 4.将Varia...
2018-06-07 21:55:43 1945
转载 Pytorch之指定GPU
转自:http://www.cnblogs.com/darkknightzh/p/6836568.html PyTorch默认使用从0开始的GPU,如果GPU0正在运行程序,需要指定其他GPU。有如下两种方法来指定需要使用的GPU。1. 类似tensorflow指定GPU的方式,使用CUDA_VISIBLE_DEVICES。1.1 直接终端中设定:CUDA_VISIBLE...
2018-06-02 20:05:00 635
原创 Pytorch之GPU模型加载在CPU上
直接在GPU上加载: pretrain = torch.load(opt.pretrain_path) model.load_state_dict(pretrain['state_dict'])将GPU模型加载在CPU上: pretrain = torch.load(opt.pretrain_path, map_location=lambda storage, loc: stora...
2018-06-02 17:30:41 8599 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人