Closed kc-w closed 10 months ago
We recommend using English or English & Chinese for issues so that we could have broader discussion.
@kc-w Hi, you custom pspnet model has custom tensorrt plugin grid_sampler
. You should build trt custom ops when installing mmdeploy according to here.
This issue is closed because it has been stale for 5 days. Please open a new issue if you have similar issues or you have any new updates now.
Checklist
Describe the bug
2022-11-02 15:04:39,839 - mmdeploy - INFO - Start pipeline mmdeploy.apis.pytorch2onnx.torch2onnx in subprocess e:\projecttest\mmsegmentation\mmseg\models\decode_heads\decode_head.py:94: UserWarning: For binary segmentation, we suggest using
out_channels = 1
to define the outputchannels of segmentor, and usethreshold
to convert seg_logist into a predictionapplying a threshold warnings.warn('For binary segmentation, we suggest using' e:\projecttest\mmsegmentation\mmseg\models\losses\cross_entropy_loss.py:235: UserWarning: Defaultavg_non_ignore
is False, if you would like to ignore the certain label and average loss over non-ignore labels, which is the same with PyTorch official cross_entropy, setavg_non_ignore=True
. warnings.warn( load checkpoint from local path: E:/projectTest/mmsegmentation/result/iter_200.pth The model and loaded state dict do not match exactlyunexpected key in source state_dict: auxiliary_head.conv_seg.weight, auxiliary_head.conv_seg.bias, auxiliary_head.convs.0.conv.weight, auxiliary_head.convs.0.bn.weight, auxiliary_head.convs.0.bn.bias, auxiliary_head.convs.0.bn.running_mean, auxiliary_head.convs.0.bn.running_var, auxiliary_head.convs.0.bn.num_batches_tracked, auxiliary_head.convs.1.conv.weight, auxiliary_head.convs.1.bn.weight, auxiliary_head.convs.1.bn.bias, auxiliary_head.convs.1.bn.running_mean, auxiliary_head.convs.1.bn.running_var, auxiliary_head.convs.1.bn.num_batches_tracked, decode_head.conv_seg.weight, decode_head.conv_seg.bias, decode_head.psp_modules.0.1.conv.weight, decode_head.psp_modules.0.1.bn.weight, decode_head.psp_modules.0.1.bn.bias, decode_head.psp_modules.0.1.bn.running_mean, decode_head.psp_modules.0.1.bn.running_var, decode_head.psp_modules.0.1.bn.num_batches_tracked, decode_head.psp_modules.1.1.conv.weight, decode_head.psp_modules.1.1.bn.weight, decode_head.psp_modules.1.1.bn.bias, decode_head.psp_modules.1.1.bn.running_mean, decode_head.psp_modules.1.1.bn.running_var, decode_head.psp_modules.1.1.bn.num_batches_tracked, decode_head.psp_modules.2.1.conv.weight, decode_head.psp_modules.2.1.bn.weight, decode_head.psp_modules.2.1.bn.bias, decode_head.psp_modules.2.1.bn.running_mean, decode_head.psp_modules.2.1.bn.running_var, decode_head.psp_modules.2.1.bn.num_batches_tracked, decode_head.psp_modules.3.1.conv.weight, decode_head.psp_modules.3.1.bn.weight, decode_head.psp_modules.3.1.bn.bias, decode_head.psp_modules.3.1.bn.running_mean, decode_head.psp_modules.3.1.bn.running_var, decode_head.psp_modules.3.1.bn.num_batches_tracked, decode_head.bottleneck.conv.weight, decode_head.bottleneck.bn.weight, decode_head.bottleneck.bn.bias, decode_head.bottleneck.bn.running_mean, decode_head.bottleneck.bn.running_var, decode_head.bottleneck.bn.num_batches_tracked
missing keys in source state_dict: neck.lateral_convs.0.conv.weight, neck.lateral_convs.0.conv.bias, neck.lateral_convs.1.conv.weight, neck.lateral_convs.1.conv.bias, neck.lateral_convs.2.conv.weight, neck.lateral_convs.2.conv.bias, neck.lateral_convs.3.conv.weight, neck.lateral_convs.3.conv.bias, neck.fpn_convs.0.conv.weight, neck.fpn_convs.0.conv.bias, neck.fpn_convs.1.conv.weight, neck.fpn_convs.1.conv.bias, neck.fpn_convs.2.conv.weight, neck.fpn_convs.2.conv.bias, neck.fpn_convs.3.conv.weight, neck.fpn_convs.3.conv.bias, decode_head.0.conv_seg.weight, decode_head.0.conv_seg.bias, decode_head.0.scale_heads.0.0.conv.weight, decode_head.0.scale_heads.0.0.bn.weight, decode_head.0.scale_heads.0.0.bn.bias, decode_head.0.scale_heads.0.0.bn.running_mean, decode_head.0.scale_heads.0.0.bn.running_var, decode_head.0.scale_heads.1.0.conv.weight, decode_head.0.scale_heads.1.0.bn.weight, decode_head.0.scale_heads.1.0.bn.bias, decode_head.0.scale_heads.1.0.bn.running_mean, decode_head.0.scale_heads.1.0.bn.running_var, decode_head.0.scale_heads.2.0.conv.weight, decode_head.0.scale_heads.2.0.bn.weight, decode_head.0.scale_heads.2.0.bn.bias, decode_head.0.scale_heads.2.0.bn.running_mean, decode_head.0.scale_heads.2.0.bn.running_var, decode_head.0.scale_heads.2.2.conv.weight, decode_head.0.scale_heads.2.2.bn.weight, decode_head.0.scale_heads.2.2.bn.bias, decode_head.0.scale_heads.2.2.bn.running_mean, decode_head.0.scale_heads.2.2.bn.running_var, decode_head.0.scale_heads.3.0.conv.weight, decode_head.0.scale_heads.3.0.bn.weight, decode_head.0.scale_heads.3.0.bn.bias, decode_head.0.scale_heads.3.0.bn.running_mean, decode_head.0.scale_heads.3.0.bn.running_var, decode_head.0.scale_heads.3.2.conv.weight, decode_head.0.scale_heads.3.2.bn.weight, decode_head.0.scale_heads.3.2.bn.bias, decode_head.0.scale_heads.3.2.bn.running_mean, decode_head.0.scale_heads.3.2.bn.running_var, decode_head.0.scale_heads.3.4.conv.weight, decode_head.0.scale_heads.3.4.bn.weight, decode_head.0.scale_heads.3.4.bn.bias, decode_head.0.scale_heads.3.4.bn.running_mean, decode_head.0.scale_heads.3.4.bn.running_var, decode_head.1.fcs.0.conv.weight, decode_head.1.fcs.0.conv.bias, decode_head.1.fcs.1.conv.weight, decode_head.1.fcs.1.conv.bias, decode_head.1.fcs.2.conv.weight, decode_head.1.fcs.2.conv.bias, decode_head.1.fc_seg.weight, decode_head.1.fc_seg.bias
2022-11-02 15:04:50,086 - mmdeploy - WARNING - DeprecationWarning: get_onnx_config will be deprecated in the future. 2022-11-02 15:04:50,087 - mmdeploy - INFO - Export PyTorch model to ONNX: E:\projectTest\mmdeploy\tools\end2end.onnx. 2022-11-02 15:04:50,199 - mmdeploy - WARNING - Can not find torch._C._jit_pass_onnx_deduplicate_initializers, function rewrite will not be applied e:\projecttest\mmsegmentation\mmseg\ops\wrappers.py:48: TracerWarning: Converting a tensor to a Python integer might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! size = [int(t self.scale_factor) for t in x.shape[-2:]] 2022-11-02 15:05:02,761 - mmdeploy - WARNING - cfg.subdivision_num_points would be changed from 8196 to 3840 due to restriction in TensorRT TopK layer E:\projectTest\mmdeploy\mmdeploy\pytorch\functions\topk.py:57: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if k > size: e:\projecttest\mmsegmentation\mmseg\models\decode_heads\point_head.py:352: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! num_points = min(height width, num_points) E:\projectTest\mmdeploy\mmdeploy\pytorch\functions\mod.py:19: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor'). return input - (input // other) other e:\projecttest\mmsegmentation\mmseg\models\decode_heads\point_head.py:362: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor'). point_coords[:, :, 1] = h_step / 2.0 + (point_indices // WARNING: The shape inference of mmdeploy::grid_sampler type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::grid_sampler type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::grid_sampler type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::grid_sampler type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::grid_sampler type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::grid_sampler type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::grid_sampler type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::grid_sampler type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::grid_sampler type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::grid_sampler type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::grid_sampler type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::grid_sampler type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. 2022-11-02 15:05:10,629 - mmdeploy - INFO - Execute onnx optimize passes. 2022-11-02 15:05:10,629 - mmdeploy - WARNING - Can not optimize model, please build torchscipt extension. More details: https://github.com/open-mmlab/mmdeploy/blob/master/docs/en/experimental/onnx_optimizer.md 2022-11-02 15:05:12,160 - mmdeploy - INFO - Finish pipeline mmdeploy.apis.pytorch2onnx.torch2onnx 2022-11-02 15:05:25,873 - mmdeploy - INFO - Start pipeline mmdeploy.backend.tensorrt.onnx2tensorrt.onnx2tensorrt in subprocess 2022-11-02 15:05:26,173 - mmdeploy - WARNING - Could not load the library of tensorrt plugins. Because the file does not exist: [11/02/2022-15:05:27] [TRT] [I] [MemUsageChange] Init CUDA: CPU +368, GPU +0, now: CPU 13145, GPU 1150 (MiB) [11/02/2022-15:05:29] [TRT] [I] [MemUsageChange] Init builder kernel library: CPU +363, GPU +104, now: CPU 13676, GPU 1254 (MiB) [11/02/2022-15:05:30] [TRT] [W] onnx2trt_utils.cpp:369: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32. [11/02/2022-15:05:30] [TRT] [W] onnx2trt_utils.cpp:395: One or more weights outside the range of INT32 was clamped [11/02/2022-15:05:30] [TRT] [W] onnx2trt_utils.cpp:395: One or more weights outside the range of INT32 was clamped Process Process-3: [11/02/2022-15:05:30] [TRT] [I] No importer registered for op: grid_sampler. Attempting to import as plugin. [11/02/2022-15:05:30] [TRT] [I] Searching for plugin: grid_sampler, plugin_version: 1, plugin_namespace: Traceback (most recent call last): File "D:\Python\Python39\lib\multiprocessing\process.py", line 315, in _bootstrap self.run() File "D:\Python\Python39\lib\multiprocessing\process.py", line 108, in run self._target(self._args, *self._kwargs) File "E:\projectTest\mmdeploy\mmdeploy\apis\core\pipeline_manager.py", line 107, in call ret = func(args, **kwargs) File "E:\projectTest\mmdeploy\mmdeploy\backend\tensorrt\onnx2tensorrt.py", line 79, in onnx2tensorrt from_onnx( File "E:\projectTest\mmdeploy\mmdeploy\backend\tensorrt\utils.py", line 166, in from_onnx raise RuntimeError(f'Failed to parse onnx, {error_msgs}') RuntimeError: Failed to parse onnx, In node 510 (importFallbackPluginImporter): UNSUPPORTED_NODE: Assertion failed: creator && "Plugin not found, are the plugin name, version, and namespace correct?"
2022-11-02 15:05:32,096 - mmdeploy - ERROR -
mmdeploy.backend.tensorrt.onnx2tensorrt.onnx2tensorrt
with Call id: 1 failed. exit.Reproduction
Environment
Error traceback
No response