torch
bald
只是做一些微小的记录。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
nll loss 和CrossEntropyLoss 的一些区别
NLL Loss在传入这个loss前,需要先对输入进行一次 log_softmax 的变换, 例子如下:import torchimport torch.nn as nnimport torch.nn.functional as Fseed=1m = nn.LogSoftmax(dim=1)loss = nn.NLLLoss()# input is of size N x C = 3 x 5input = torch.randn(3, 5, requires_grad=True)pri原创 2020-12-28 19:04:34 · 1926 阅读 · 0 评论 -
mac 安装 pytorch_geometric ‘gcc‘ failed with exit status 1
遇到了官网提到的问题9:On macOS: ‘gcc’ failed with exit status 1: Install the respective packages by using the following environment variables (see Issue#21):MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install然而这个命令是不对的,去看Issus#21提到的解决方案第一原创 2020-12-09 10:19:57 · 461 阅读 · 0 评论 -
RuntimeError: expected device cpu but got device cuda:0 --每天一个写 bug 小技巧
这是一个综合 debug 方法:不管是 expected cpu 还是 expected cuda, 本质原因都是类型不匹配。一般是因为:等号左边和右边类型不一样运算符左右两端类型不同同一个函数内,传入参数类型不同,比如 mutual...原创 2020-04-30 15:46:55 · 5475 阅读 · 4 评论
分享