c++与libtorch混合编程:std:runtime_error及c10:error报错分析
c++与libtorch混合编程:std:runtime_error及c10:error报错分析模型文件pt转换要点在c++中,device=torch::kCPU时,报错分析在c++中,device=torch::kCUDA时,报错分析模型文件pt转换要点pth转换成pt文件时,尽量用cuda转换,即input_tensor.cuda()#模型输入张量放在gpu上model.cuda()#模型放在gpu上因为用gpu转换后的模型文件,在c++中可以在cpu上进行预测也可以在gpu上进行预测
原创
2021-04-14 14:26:10 ·
11673 阅读 ·
47 评论