i exported the model into torchscript format, and when i use the exported model to inference on image,it only can inference on the image that i used for exporting model, but for other image,it cann't work,and the error message is:
/root/miniconda3/envs/deepsolo/lib/python3.8/site-packages/torch/nn/modules/module.py:1051: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at /pytorch/c10/core/TensorImpl.h:1156.)
return forward_call(*input, *kwargs)
Traceback (most recent call last):
File "/root/autodl-tmp/project/deploy/export_model.py", line 264, in
out1 = m(data)
File "/root/miniconda3/envs/deepsolo/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(input, **kwargs)
RuntimeError: The following operation failed in the TorchScript interpreter.
Traceback of TorchScript, serialized code (most recent call last):
File "code/torch/detectron2/export/flatten.py", line 9, in forward
def forward(self: torch.detectron2.export.flatten.TracingAdapter,
argument_1: Tensor) -> Tuple[Tensor, Tensor, Tensor, Tensor, Tensor, Tensor, Tensor]:
_0, _1, _2, _3, _4, _5, _6, = (self.model).forward(argument_1, )
i exported the model into torchscript format, and when i use the exported model to inference on image,it only can inference on the image that i used for exporting model, but for other image,it cann't work,and the error message is: /root/miniconda3/envs/deepsolo/lib/python3.8/site-packages/torch/nn/modules/module.py:1051: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at /pytorch/c10/core/TensorImpl.h:1156.) return forward_call(*input, *kwargs) Traceback (most recent call last): File "/root/autodl-tmp/project/deploy/export_model.py", line 264, in
out1 = m(data)
File "/root/miniconda3/envs/deepsolo/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call( input, **kwargs)
RuntimeError: The following operation failed in the TorchScript interpreter.
Traceback of TorchScript, serialized code (most recent call last):
File "code/torch/detectron2/export/flatten.py", line 9, in forward
def forward(self: torch.detectron2.export.flatten.TracingAdapter,
argument_1: Tensor) -> Tuple[Tensor, Tensor, Tensor, Tensor, Tensor, Tensor, Tensor]:
_0, _1, _2, _3, _4, _5, _6, = (self.model).forward(argument_1, )