Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [Bug] Log print misleading error messages when there is unsupported operator #923

Closed
bowang007 opened this issue Mar 11, 2022 · 2 comments · Fixed by #918
Closed

🐛 [Bug] Log print misleading error messages when there is unsupported operator #923

bowang007 opened this issue Mar 11, 2022 · 2 comments · Fixed by #918
Assignees
Labels
bug Something isn't working component: partitioning

Comments

@bowang007
Copy link
Collaborator

bowang007 commented Mar 11, 2022

Bug Description

When we have some unsupported operator in a network, it will automatically fallback with some messages showing that this operator is not supported. However, currently the message is misleading because it shows as an error which may make users think the compilation failed.

To Reproduce

For example, have many errors such as this we I support MaskRCNN:

ERROR: [Torch-TensorRT - Debug Build] - Unsupported operator: aten::max.dim(Tensor self, int dim, bool keepdim=False) -> (Tensor values, Tensor indices)
/home/bo/Projects/detectron2/detectron2/structures/image_list.py(83): from_tensors
/home/bo/Projects/detectron2/detectron2/modeling/meta_arch/rcnn.py(226): preprocess_image
/home/bo/Projects/detectron2/detectron2/modeling/meta_arch/rcnn.py(199): inference
export_model.py(112): inference
/home/bo/Projects/detectron2/detectron2/export/flatten.py(294): forward
/home/bo/.local/lib/python3.6/site-packages/torch/nn/modules/module.py(1090): _slow_forward
/home/bo/.local/lib/python3.6/site-packages/torch/nn/modules/module.py(1102): _call_impl
/home/bo/.local/lib/python3.6/site-packages/torch/jit/_trace.py(965): trace_module
/home/bo/.local/lib/python3.6/site-packages/torch/jit/_trace.py(750): trace
export_model.py(121): export_tracing
export_model.py(221): <module>
Serialized   File "code/__torch__/detectron2/export/flatten.py", line 24
    _1 = ops.prim.NumToTensor(torch.size(t, 2))
    image_size = torch.stack([_0, _1])
    max_size, _2 = torch.max(torch.stack([image_size]), 0)
                   ~~~~~~~~~ <--- HERE
    _3 = torch.div(torch.add(max_size, CONSTANTS.c0), CONSTANTS.c1, rounding_mode="floor")
    max_size0 = torch.mul(_3, CONSTANTS.c1)

Expected behavior

Give a warning, rather than error.

Additional context

will raise a PR for this soon.

@bowang007 bowang007 added the bug Something isn't working label Mar 11, 2022
@bowang007 bowang007 self-assigned this Mar 11, 2022
@narendasan
Copy link
Collaborator

I have a fix for this as part of #918

@chaoz-dev
Copy link
Contributor

For vis, related to #803

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: partitioning
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants