You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
11/22 15:16:18 - mmengine - INFO - Start pipeline mmdeploy.apis.pytorch2onnx.torch2onnx in subprocess
11/22 15:16:19 - mmengine - WARNING - Failed to search registry with scope "mmseg" in the "Codebases" registry tree. As a workaround, the current "Codebases" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmseg" is a correct scope, or whether the registry is initialized.
11/22 15:16:19 - mmengine - WARNING - Failed to search registry with scope "mmseg" in the "mmseg_tasks" registry tree. As a workaround, the current "mmseg_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmseg" is a correct scope, or whether the registry is initialized.
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmcv/cnn/bricks/hsigmoid.py:35: UserWarning: In MMCV v1.4.4, we modified the default value of args to align with PyTorch official. Previous Implementation: Hsigmoid(x) = min(max((x + 1) / 2, 0), 1). Current Implementation: Hsigmoid(x) = min(max((x + 3) / 6, 0), 1).
warnings.warn(
check in_channels (16, 24, 960)
/mmsegmentation-main/mmsegmentation/mmseg/models/decode_heads/decode_head.py:121: UserWarning: For binary segmentation, we suggest usingout_channels = 1 to define the outputchannels of segmentor, and use thresholdto convert seg_logits into a predictionapplying a threshold
warnings.warn('For binary segmentation, we suggest using'
/mmsegmentation-main/mmsegmentation/mmseg/models/losses/cross_entropy_loss.py:250: UserWarning: Default avg_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, set avg_non_ignore=True.
warnings.warn(
Loads checkpoint by local backend from path: ../work_dirs/mobilenet-v3-d8_lraspp_4xb4-320k_skinseg-512x512-1122/iter_80000.pth
11/22 15:16:20 - mmengine - WARNING - DeprecationWarning: get_onnx_config will be deprecated in the future.
11/22 15:16:20 - mmengine - INFO - Export PyTorch model to ONNX: mmdeploy_models/mmseg/ort-1122/end2end.onnx.
11/22 15:16:20 - mmengine - WARNING - Can not find torch.nn.functional.scaled_dot_product_attention, function rewrite will not be applied
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmdeploy/core/optimizers/function_marker.py:160: 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!
ys_shape = tuple(int(s) for s in ys.shape)
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmdeploy/codebase/mmseg/models/segmentors/base.py:47: 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!
img_shape = [int(val) for val in img_shape]
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmcv/cnn/bricks/conv2d_adaptive_padding.py:50: TracerWarning: Converting a tensor to a Python float 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!
output_h = math.ceil(img_h / stride_h)
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmcv/cnn/bricks/conv2d_adaptive_padding.py:51: TracerWarning: Converting a tensor to a Python float 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!
output_w = math.ceil(img_w / stride_w)
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmcv/cnn/bricks/conv2d_adaptive_padding.py:53: 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!
max((output_h - 1) * self.stride[0] +
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmcv/cnn/bricks/conv2d_adaptive_padding.py:56: 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!
max((output_w - 1) * self.stride[1] +
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmcv/cnn/bricks/conv2d_adaptive_padding.py:58: 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 pad_h > 0 or pad_w > 0:
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmdeploy/codebase/mmseg/models/segmentors/base.py:61: 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 seg_logit.shape[1] == 1:
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/torch/onnx/utils.py:687: UserWarning: The shape inference of prim::Constant type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. (Triggered internally at ../torch/csrc/jit/passes/onnx/shape_type_inference.cpp:1884.)
_C._jit_pass_onnx_graph_shape_type_inference(
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/torch/onnx/utils.py:687: UserWarning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied. (Triggered internally at ../torch/csrc/jit/passes/onnx/constant_fold.cpp:179.)
_C._jit_pass_onnx_graph_shape_type_inference(
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/torch/onnx/utils.py:1178: UserWarning: The shape inference of prim::Constant type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. (Triggered internally at ../torch/csrc/jit/passes/onnx/shape_type_inference.cpp:1884.)
_C._jit_pass_onnx_graph_shape_type_inference(
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/torch/onnx/utils.py:1178: UserWarning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied. (Triggered internally at ../torch/csrc/jit/passes/onnx/constant_fold.cpp:179.)
_C._jit_pass_onnx_graph_shape_type_inference(
11/22 15:16:25 - mmengine - INFO - Execute onnx optimize passes.
11/22 15:16:25 - mmengine - WARNING - Can not optimize model, please build torchscipt extension.
More details: mmdeploy/docs/en/experimental/onnx_optimizer.md at main · open-mmlab/mmdeploy
11/22 15:16:25 - mmengine - INFO - Finish pipeline mmdeploy.apis.pytorch2onnx.torch2onnx
11/22 15:16:26 - mmengine - INFO - Start pipeline mmdeploy.apis.utils.utils.to_backend in main process
11/22 15:16:26 - mmengine - INFO - Finish pipeline mmdeploy.apis.utils.utils.to_backend
11/22 15:16:26 - mmengine - INFO - visualize onnxruntime model start.
11/22 15:16:30 - mmengine - WARNING - Failed to search registry with scope "mmseg" in the "Codebases" registry tree. As a workaround, the current "Codebases" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmseg" is a correct scope, or whether the registry is initialized.
11/22 15:16:30 - mmengine - WARNING - Failed to search registry with scope "mmseg" in the "mmseg_tasks" registry tree. As a workaround, the current "mmseg_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmseg" is a correct scope, or whether the registry is initialized.
11/22 15:16:30 - mmengine - WARNING - Failed to search registry with scope "mmseg" in the "backend_segmentors" registry tree. As a workaround, the current "backend_segmentors" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmseg" is a correct scope, or whether the registry is initialized.
11/22 15:16:30 - mmengine - INFO - Successfully loaded onnxruntime custom ops from /home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmdeploy/lib/libmmdeploy_onnxruntime_ops.so
11/22 15:17:05 - mmengine - INFO - visualize onnxruntime model success.
11/22 15:17:05 - mmengine - INFO - visualize pytorch model start.
11/22 15:17:08 - mmengine - WARNING - Failed to search registry with scope "mmseg" in the "Codebases" registry tree. As a workaround, the current "Codebases" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmseg" is a correct scope, or whether the registry is initialized.
11/22 15:17:08 - mmengine - WARNING - Failed to search registry with scope "mmseg" in the "mmseg_tasks" registry tree. As a workaround, the current "mmseg_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmseg" is a correct scope, or whether the registry is initialized.
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmcv/cnn/bricks/hsigmoid.py:35: UserWarning: In MMCV v1.4.4, we modified the default value of args to align with PyTorch official. Previous Implementation: Hsigmoid(x) = min(max((x + 1) / 2, 0), 1). Current Implementation: Hsigmoid(x) = min(max((x + 3) / 6, 0), 1).
warnings.warn(
check in_channels (16, 24, 960)
/mmsegmentation-main/mmsegmentation/mmseg/models/decode_heads/decode_head.py:121: UserWarning: For binary segmentation, we suggest usingout_channels = 1 to define the outputchannels of segmentor, and use thresholdto convert seg_logits into a predictionapplying a threshold
warnings.warn('For binary segmentation, we suggest using'
/mmsegmentation-main/mmsegmentation/mmseg/models/losses/cross_entropy_loss.py:250: UserWarning: Default avg_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, set avg_non_ignore=True.
warnings.warn(
Loads checkpoint by local backend from path: ../work_dirs/mobilenet-v3-d8_lraspp_4xb4-320k_skinseg-512x512-1122/iter_80000.pth
11/22 15:17:44 - mmengine - INFO - visualize pytorch model success.
11/22 15:17:44 - mmengine - INFO - All process success.
Checklist
Describe the bug
mmsegmentation-main/mmdeploy$ python tools/deploy.py \
11/22 15:16:18 - mmengine - INFO - Start pipeline mmdeploy.apis.pytorch2onnx.torch2onnx in subprocess
11/22 15:16:19 - mmengine - WARNING - Failed to search registry with scope "mmseg" in the "Codebases" registry tree. As a workaround, the current "Codebases" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmseg" is a correct scope, or whether the registry is initialized.
11/22 15:16:19 - mmengine - WARNING - Failed to search registry with scope "mmseg" in the "mmseg_tasks" registry tree. As a workaround, the current "mmseg_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmseg" is a correct scope, or whether the registry is initialized.
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmcv/cnn/bricks/hsigmoid.py:35: UserWarning: In MMCV v1.4.4, we modified the default value of args to align with PyTorch official. Previous Implementation: Hsigmoid(x) = min(max((x + 1) / 2, 0), 1). Current Implementation: Hsigmoid(x) = min(max((x + 3) / 6, 0), 1).
warnings.warn(
check in_channels (16, 24, 960)
/mmsegmentation-main/mmsegmentation/mmseg/models/decode_heads/decode_head.py:121: UserWarning: For binary segmentation, we suggest using
out_channels = 1
to define the outputchannels of segmentor, and usethreshold
to convertseg_logits
into a predictionapplying a thresholdwarnings.warn('For binary segmentation, we suggest using'
/mmsegmentation-main/mmsegmentation/mmseg/models/losses/cross_entropy_loss.py:250: UserWarning: Default
avg_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(
Loads checkpoint by local backend from path: ../work_dirs/mobilenet-v3-d8_lraspp_4xb4-320k_skinseg-512x512-1122/iter_80000.pth
11/22 15:16:20 - mmengine - WARNING - DeprecationWarning: get_onnx_config will be deprecated in the future.
11/22 15:16:20 - mmengine - INFO - Export PyTorch model to ONNX: mmdeploy_models/mmseg/ort-1122/end2end.onnx.
11/22 15:16:20 - mmengine - WARNING - Can not find torch.nn.functional.scaled_dot_product_attention, function rewrite will not be applied
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmdeploy/core/optimizers/function_marker.py:160: 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!
ys_shape = tuple(int(s) for s in ys.shape)
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmdeploy/codebase/mmseg/models/segmentors/base.py:47: 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!
img_shape = [int(val) for val in img_shape]
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmcv/cnn/bricks/conv2d_adaptive_padding.py:50: TracerWarning: Converting a tensor to a Python float 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!
output_h = math.ceil(img_h / stride_h)
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmcv/cnn/bricks/conv2d_adaptive_padding.py:51: TracerWarning: Converting a tensor to a Python float 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!
output_w = math.ceil(img_w / stride_w)
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmcv/cnn/bricks/conv2d_adaptive_padding.py:53: 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!
max((output_h - 1) * self.stride[0] +
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmcv/cnn/bricks/conv2d_adaptive_padding.py:56: 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!
max((output_w - 1) * self.stride[1] +
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmcv/cnn/bricks/conv2d_adaptive_padding.py:58: 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 pad_h > 0 or pad_w > 0:
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmdeploy/codebase/mmseg/models/segmentors/base.py:61: 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 seg_logit.shape[1] == 1:
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/torch/onnx/utils.py:687: UserWarning: The shape inference of prim::Constant type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. (Triggered internally at ../torch/csrc/jit/passes/onnx/shape_type_inference.cpp:1884.)
_C._jit_pass_onnx_graph_shape_type_inference(
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/torch/onnx/utils.py:687: UserWarning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied. (Triggered internally at ../torch/csrc/jit/passes/onnx/constant_fold.cpp:179.)
_C._jit_pass_onnx_graph_shape_type_inference(
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/torch/onnx/utils.py:1178: UserWarning: The shape inference of prim::Constant type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. (Triggered internally at ../torch/csrc/jit/passes/onnx/shape_type_inference.cpp:1884.)
_C._jit_pass_onnx_graph_shape_type_inference(
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/torch/onnx/utils.py:1178: UserWarning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied. (Triggered internally at ../torch/csrc/jit/passes/onnx/constant_fold.cpp:179.)
_C._jit_pass_onnx_graph_shape_type_inference(
11/22 15:16:25 - mmengine - INFO - Execute onnx optimize passes.
11/22 15:16:25 - mmengine - WARNING - Can not optimize model, please build torchscipt extension.
More details: mmdeploy/docs/en/experimental/onnx_optimizer.md at main · open-mmlab/mmdeploy
11/22 15:16:25 - mmengine - INFO - Finish pipeline mmdeploy.apis.pytorch2onnx.torch2onnx
11/22 15:16:26 - mmengine - INFO - Start pipeline mmdeploy.apis.utils.utils.to_backend in main process
11/22 15:16:26 - mmengine - INFO - Finish pipeline mmdeploy.apis.utils.utils.to_backend
11/22 15:16:26 - mmengine - INFO - visualize onnxruntime model start.
11/22 15:16:30 - mmengine - WARNING - Failed to search registry with scope "mmseg" in the "Codebases" registry tree. As a workaround, the current "Codebases" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmseg" is a correct scope, or whether the registry is initialized.
11/22 15:16:30 - mmengine - WARNING - Failed to search registry with scope "mmseg" in the "mmseg_tasks" registry tree. As a workaround, the current "mmseg_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmseg" is a correct scope, or whether the registry is initialized.
11/22 15:16:30 - mmengine - WARNING - Failed to search registry with scope "mmseg" in the "backend_segmentors" registry tree. As a workaround, the current "backend_segmentors" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmseg" is a correct scope, or whether the registry is initialized.
11/22 15:16:30 - mmengine - INFO - Successfully loaded onnxruntime custom ops from /home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmdeploy/lib/libmmdeploy_onnxruntime_ops.so
11/22 15:17:05 - mmengine - INFO - visualize onnxruntime model success.
11/22 15:17:05 - mmengine - INFO - visualize pytorch model start.
11/22 15:17:08 - mmengine - WARNING - Failed to search registry with scope "mmseg" in the "Codebases" registry tree. As a workaround, the current "Codebases" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmseg" is a correct scope, or whether the registry is initialized.
11/22 15:17:08 - mmengine - WARNING - Failed to search registry with scope "mmseg" in the "mmseg_tasks" registry tree. As a workaround, the current "mmseg_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmseg" is a correct scope, or whether the registry is initialized.
/home/itdtirtx/anaconda3/envs/tgp/lib/python3.8/site-packages/mmcv/cnn/bricks/hsigmoid.py:35: UserWarning: In MMCV v1.4.4, we modified the default value of args to align with PyTorch official. Previous Implementation: Hsigmoid(x) = min(max((x + 1) / 2, 0), 1). Current Implementation: Hsigmoid(x) = min(max((x + 3) / 6, 0), 1).
warnings.warn(
check in_channels (16, 24, 960)
/mmsegmentation-main/mmsegmentation/mmseg/models/decode_heads/decode_head.py:121: UserWarning: For binary segmentation, we suggest using
out_channels = 1
to define the outputchannels of segmentor, and usethreshold
to convertseg_logits
into a predictionapplying a thresholdwarnings.warn('For binary segmentation, we suggest using'
/mmsegmentation-main/mmsegmentation/mmseg/models/losses/cross_entropy_loss.py:250: UserWarning: Default
avg_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(
Loads checkpoint by local backend from path: ../work_dirs/mobilenet-v3-d8_lraspp_4xb4-320k_skinseg-512x512-1122/iter_80000.pth
11/22 15:17:44 - mmengine - INFO - visualize pytorch model success.
11/22 15:17:44 - mmengine - INFO - All process success.
Reproduction
python tools/deploy.py
configs/mmseg/segmentation_onnxruntime_static-512x512.py
../configs/mobilenet_v3/mobilenet-v3-d8_lraspp_4xb4-320k_skinseg-512x512.py
../work_dirs/mobilenet-v3-d8_lraspp_4xb4-320k_skinseg-512x512-1122/iter_80000.pth
demo/15kdata_20240501_44.jpg
--work-dir mmdeploy_models/mmseg/ort-1122
Environment
Error traceback
No response
The text was updated successfully, but these errors were encountered: