Pytorch Debug 记录
竹竹竹~
这个作者很懒,什么都没留下…
展开
-
用TorchSnooper工具解决pytorch代码常见错误
在pytorch代码编写过程中,经常容易碰到一类错误,比如:RuntimeError: Expected object of scalar type Float but got scalar type Double for argument #4 'mat1' Expected object of backend CPU but got backend CUDA for sequence...原创 2020-04-01 10:26:24 · 805 阅读 · 0 评论 -
RuntimeError: "softmax" not implemented for 'torch.LongTensor'
写了一小段代码来进行pytorch中tensor的维度变换实验,实验代码如下所示:import torchimport numpy as npa = np.array([[[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]], [[11, 12, 13, 14, 15], [16, 17, 18, 19, 20]], [[21, 22, 23, 24, 25], [26...原创 2020-04-01 10:01:38 · 6197 阅读 · 2 评论