在pycharm将训练好的网络模型加载号后,创建一个example输入,使用torch.jit.trace 保存的模型和torch.jit.script保存的模型都出现了torch::jit::Errorreport错误,是网路模型内部出现了其他不属于torch的变量导致的吗
c++代码
###
torch::jit::script::Module module;
//module = torch::jit::load("./resNetFpn-model-14_jit.pt");
module = torch::jit::load("./resNetFpn-model-14_jitscript.pt");###
运行结果及报错内容
try catch异常捕捉结果
```
10
[ CPULongType{} ]
cuda::is_available():0
cudNN::is_available():0
Unknown builtin op: torchvision::nms.
Could not find any similar ops to torchvision::nms. This op may not exist or may not be currently supported in TorchScript.
:
File "boxes.py", line 35
by NMS, sorted in decreasing order of scores
"""
return torch.ops.torchvision.nms(boxes, scores, iou_threshold)
~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
```c++