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
I have searched related issues but cannot get the expected help.
2. I have read the FAQ documentation but cannot get the expected help.
3. The bug has not been fixed in the latest version.
Describe the bug
I converted the SATRN to onnx by using dynamic config, when inference in batch size=1, result is correct, but when batch size > 1, the results will be same except first image.
It seems that there are some variables been fixed when converting to onnx, the log shows some warning:
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"in the "mmocr_tasks" registry tree. As a workaround, the current "mmocr_tasks" registry in"mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"in the "mmocr_tasks" registry tree. As a workaround, the current "mmocr_tasks" registry in"mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"in the "mmocr_tasks" registry tree. As a workaround, the current "mmocr_tasks" registry in"mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"in the "mmocr_tasks" registry tree. As a workaround, the current "mmocr_tasks" registry in"mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"in the "mmocr_tasks" registry tree. As a workaround, the current "mmocr_tasks" registry in"mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:36 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:38 - mmengine - INFO - Start pipeline mmdeploy.apis.pytorch2onnx.torch2onnx in subprocess
05/24 03:36:40 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:40 - mmengine - WARNING - Failed to search registry with scope "mmocr"in the "mmocr_tasks" registry tree. As a workaround, the current "mmocr_tasks" registry in"mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmocr" is a correct scope, or whether the registry is initialized.
05/24 03:36:40 - mmengine - WARNING - Failed to search registry with scope "mmocr"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 "mmocr" is a correct scope, or whether the registry is initialized.
Loads checkpoint by local backend from path: /code/mmocr/run_test1/epoch_20.pth
05/24 03:36:41 - mmengine - WARNING - DeprecationWarning: get_onnx_config will be deprecated in the future.
05/24 03:36:41 - mmengine - INFO - Export PyTorch model to ONNX: work_dir_ocr/end2end.onnx.
05/24 03:36:41 - mmengine - WARNING - Can not find torch._C._jit_pass_onnx_autograd_function_process, functionrewrite will not be applied
05/24 03:36:41 - mmengine - WARNING - Can not find mmdet.models.dense_heads.DETRHead.forward_single, functionrewrite will not be applied
/code/mmocr/mmocr/models/textrecog/encoders/satrn_encoder.py:85: 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! valid_width = min(w, math.ceil(w * valid_ratio))/code/mmocr/mmocr/models/textrecog/encoders/satrn_encoder.py:85: 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!
valid_width = min(w, math.ceil(w * valid_ratio))
/code/mmocr/mmocr/models/textrecog/decoders/nrtr_decoder.py:137: 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! valid_width = min(T, math.ceil(T * valid_ratio))/code/mmocr/mmocr/models/textrecog/decoders/nrtr_decoder.py:137: 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!
valid_width = min(T, math.ceil(T * valid_ratio))
/root/workspace/mmdeploy/mmdeploy/codebase/mmocr/models/text_recognition/transformer_module.py:23: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this functionto create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.
1.0 / torch.tensor(10000).to(device).pow(
/root/workspace/mmdeploy/mmdeploy/codebase/mmocr/models/text_recognition/transformer_module.py:24: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this functionto create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.
torch.tensor(2 * (hid_j // 2) / d_hid)).to(device)
/root/workspace/mmdeploy/mmdeploy/codebase/mmocr/models/text_recognition/transformer_module.py:22: TracerWarning: torch.Tensor results are registered as constants in the trace. You can safely ignore this warning if you use this functionto create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.
denominator = torch.Tensor([
/root/workspace/mmdeploy/mmdeploy/codebase/mmocr/models/text_recognition/transformer_module.py:22: 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! denominator = torch.Tensor([Warning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied.Warning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied.Warning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied.Warning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied.....
Checklist
Describe the bug
I converted the SATRN to onnx by using dynamic config, when inference in batch size=1, result is correct, but when batch size > 1, the results will be same except first image.
convert command:
inference code:
it shows:
It seems that there are some variables been fixed when converting to onnx, the log shows some warning:
Reproduction
config.py
:Environment
Error traceback
No response
The text was updated successfully, but these errors were encountered: