Editing forward functions of MobileNetV2 or other backboned models #1475
-
I want to use mobilenetv2, one of the backboned models defined in mmpretrain, as a backboned model in mmfewshot. I explained the problem I had there in the link below. 1: https://github.com/open-mmlab/mmpretrain/blob/main/mmpretrain/models/backbones/mobilenet_v2.py In short, the forward part of the code in 1 returns {tuple :1}. It contains {Tensor: (25,1280,3,3). 2 gives direct output as {Tensor:(25,1600)}. After that, I want to use Ptotypical Networks, so I need to get output as in 2. How can I do it without breaking the model structure? It is very important for me to solve this critical point, can you help me? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
the From :
To:
|
Beta Was this translation helpful? Give feedback.
-
I got the following error when I applied the technique you said. I solved my problem by updating the forward function like this.. Thank You :) |
Beta Was this translation helpful? Give feedback.
I got the following error when I applied the technique you said.
I solved my problem by updating the forward function like this.. Thank You :)