![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytorch
ASR_THU
研究方向:语音处理
展开
-
[pytorch] 在pytorch中实现与TensorFlow类似的same方式padding
转载自https://oldpan.me/archives/pytorch-same-padding-tflike前言TensorFlow中在使用卷积层函数的时候有一个参数padding可以选择same或者vaild,具体可以看之前的这篇文章:https://oldpan.me/archives/tf-keras-padding-vaild-same.而在pytorch中,现在的版本...转载 2019-05-06 17:22:22 · 3218 阅读 · 0 评论 -
[pytorch] 每次训练的结果都不同(无法复现)
原因: 没有设置seed,torch的一些操作有随机性。解决:https://github.com/pytorch/pytorch/issues/7068 torch.manual_seed(seed) torch.cuda.manual_seed(seed) torch.cuda.manual_seed_all(seed) # if you are using ...原创 2019-06-05 18:11:56 · 12880 阅读 · 1 评论 -
[pytorch] 名词理解
in - place operationhttps://discuss.pytorch.org/t/what-is-in-place-operation/16244https://zhuanlan.zhihu.com/p/38475183An in-place operation is an operation that changes directly the content of...原创 2019-06-10 17:25:10 · 289 阅读 · 0 评论 -
[pytorch] 运行一段时间后 GPU OOM
pytorch的dataloader会将数据传到GPU上,这个过程GPU的mem占用会逐渐增加,为了避免GPUmen被无用的数据占用,可以在每个step后用del删除一些变量,也可以使用torch.cuda.empty_cache()释放显存:del targets, input_k, input_masktorch.cuda.empty_cache()这时能观察到GPU的显存一直在动...原创 2019-08-06 19:08:50 · 3541 阅读 · 1 评论 -
[pytorch] freeze parameters in sub model
https://discuss.pytorch.org/t/how-the-pytorch-freeze-network-in-some-layers-only-the-rest-of-the-training/7088原创 2019-08-09 09:27:01 · 756 阅读 · 0 评论