0
点赞
收藏
分享

微信扫一扫

LIBTORCH C++

杰克逊爱学习 2022-01-26 阅读 74
c++ubuntu

1:Ubuntu18.04 配置 LibTorch_不忘初心~-CSDN博客_ubuntu安装libtorch

2:You need C++14 to compile PyTorch

Ubuntu下C++调用pytorch训练好模型--利用libtorch - 灰信网(软件开发博客聚合)

3:Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same

错误内容大概就是指输入类型是CPU(torch.FloatTensor),而参数类型是GPU(torch.cuda.FloatTensor)。
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
inputs.to(device)
或者
 tensor_image = tensor_image.unsqueeze(0).cuda();
举报

相关推荐

0 条评论