PyTorch
grllery
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
pytorch固定BN层参数
背景:基于PyTorch的模型,想固定主分支参数,只训练子分支,结果发现在不同epoch相同的测试数据经过主分支输出的结果不同。 原因:未固定主分支BN层中的running_mean和running_var。 解决方法:将需要固定的BN层状态设置为eval。 问题示例: 环境:torch:1.7.0 # -*- coding:utf-8 -*- import torch import torch.nn as nn import torch.nn.functional as F class Net(nn.M原创 2020-11-29 19:49:42 · 6345 阅读 · 5 评论 -
pytorch .data
What about .data? .data was the primary way to get the underlying Tensor from a Variable. After this merge, calling y = x.data still has similar semantics. So y will be a Tensor that shares the same d...转载 2019-10-16 20:11:12 · 505 阅读 · 0 评论 -
torch.nn和torch.nn.functional的区别
Difference of methods between torch.nn and functional Q: Both torch.nn and functional have methods such as Conv2d, Max Pooling, ReLU etc. However, many public codes writes Conv and Linear layer in a c...转载 2019-10-16 16:06:22 · 716 阅读 · 1 评论 -
Windows下通过pip安装PyTorch 0.4.0 import 不成功
问题:通过pip安装PyTorch 0.4.0成功,但是import时报错。 import torch File "D:\Python\Python36\lib\site-packages\torch\__init__.py", line 78, in <module> from torch._C import *ImportError: DLL load failed: 找...原创 2018-05-14 12:47:23 · 10997 阅读 · 17 评论 -
PyTorch保存和加载模型
转自: http://www.cnblogs.com/darkknightzh/p/8108466.html 参考网址: https://pytorch.org/tutorials/beginner/saving_loading_models.html https://pytorch.org/docs/stable/notes/serialization.html#best-practic...转载 2018-05-23 20:11:39 · 1192 阅读 · 0 评论
分享