TypeError: forward() missing 1 required positional argument: 'img_metas'
See original GitHub issueSorry for this basic doubt. I am trying to worl with the SWIN transformer backbone and need to do a forward pass for the model in order to achieve quantization with the help of the Tensor-RT library .I am trying to do so using: model('img_path')
.
However, I get the following error : TypeError: forward() missing 1 required positional argument: 'img_metas'
I am not really sure what exactly does the method exactly expects as img_metas. If I am wrong in trying to do a forward pass with this, Is there a better or a different way to do this?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:12
Top Results From Across the Web
using torch.jit.trace() and it goes TypeError: forward() missing ...
using torch.jit.trace() and it goes TypeError: forward() missing 1 required positional argument: 'img_metas' #7988.
Read more >TypeError: forward() missing 1 required positional argument ...
I think the error message is pretty straight forward. You have two positional arguments input_tokens and hidden for your forward() .
Read more >forward() missing 1 required positional argument - Xilinx Support
I changed resnet18_quant.py to quantize my model?the .py file like this: import osimport argparseimport randomfrom pytorch_nndct.apis import ...
Read more >forward() missing 1 required positional argument: 'target' when ...
I am trying to build a next word prediction model with pytorch in google colab. As my vocabulary size is over 1.5 million,...
Read more >TypeError: forward() missing 1 required positional argument: 'x'
TypeError : forward() missing 1 required positional argument: 'x' ... 1 frames <ipython-input-13-3ff21b7150f2> in run_train_test() ---> 17 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Assuming all your input data is uniformly formatted, you can manually create the dict and construct your own
img_metas
list. I set a breakpoint in a function containingimg_metas
and copied one of the results.I haven’t tested if the augmentation parameters (e.g. flip, flip_direction) affect the results.
@dnth I am trying to use a MASK RCNN model with a SWIN transformer backbone.