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
The detectron2 documentation mentions that dynamic batch inputs are supported for scripted models. However, I am struggling with changing https://github.com/facebookresearch/detectron2/blob/main/tools/deploy/torchscript_mask_rcnn.cpp to support batch inputs for the scripted model. I tried creating a stack with multiple inputs and sending it to model forward but it led to an error.
c10::Stack stack_batch{
std::make_tuple(dic),
std::make_tuple(dic)};
auto output = model.forward(stack_batch);
Error: Expected at most 2 argument(s) for operator 'forward', but received 3 argument(s). Declaration:
forward(__torch__.ScriptableAdapter self, (Dict(str, Tensor)) inputs) -> (Dict(str, Tensor)[][])
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have used https://github.com/facebookresearch/detectron2/tree/main/tools/deploy to generate a scripted faster rcnn and I am able to run it in C++ for a batch size 1.
The detectron2 documentation mentions that dynamic batch inputs are supported for scripted models. However, I am struggling with changing https://github.com/facebookresearch/detectron2/blob/main/tools/deploy/torchscript_mask_rcnn.cpp to support batch inputs for the scripted model. I tried creating a stack with multiple inputs and sending it to model forward but it led to an error.
Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions