GithubHelp home page GithubHelp logo

RuntimeError: The size of tensor a (13) must match the size of tensor b (70135) at non-singleton dimension 3 about fewshot_detection HOT 9 OPEN

bingykang avatar bingykang commented on July 18, 2024
RuntimeError: The size of tensor a (13) must match the size of tensor b (70135) at non-singleton dimension 3

from fewshot_detection.

Comments (9)

SoonFa avatar SoonFa commented on July 18, 2024 4
pred_boxes[0] = x.data.view(nB*nA*nH*nW) + grid_x
pred_boxes[1] = y.data.view(nB*nA*nH*nW) + grid_y
pred_boxes[2] = torch.exp(w.data).view(nB*nA*nH*nW) * anchor_w
pred_boxes[3] = torch.exp(h.data).view(nB*nA*nH*nW) * anchor_h

from fewshot_detection.

risemeup avatar risemeup commented on July 18, 2024

@bahulkark hello,I met the same mistake with you. Have you fixed it ?

from fewshot_detection.

bahulkark avatar bahulkark commented on July 18, 2024

from fewshot_detection.

tailororrr avatar tailororrr commented on July 18, 2024

I met the same mistake with you

from fewshot_detection.

azharshaikh06 avatar azharshaikh06 commented on July 18, 2024

Anyone have a fix for this?

from fewshot_detection.

cgg99 avatar cgg99 commented on July 18, 2024

Is the pytorch version wrong?

from fewshot_detection.

azharshaikh06 avatar azharshaikh06 commented on July 18, 2024

I am using torch 1.4 and can perform the forward pass through the model error is in the regionloss.py pred_boxes[0] = x.data + grid_x here x.data is a 4D tensor while grid_x is a 2D tensor

from fewshot_detection.

zhanghao5 avatar zhanghao5 commented on July 18, 2024

I am using pytorch 1.7. With the view() method I can reshape and fit in the addition
pred_boxes[0] = x.data.view(nBnAnHnW) + grid_x
pred_boxes[1] = y.data.view(nB
nAnHnW)+ grid_y
pred_boxes[2] = torch.exp(w.data).view(nBnAnHnW) * anchor_w
pred_boxes[3] = torch.exp(h.data).view(nB
nAnHnW) * anchor_h

from fewshot_detection.

HeuristicLU avatar HeuristicLU commented on July 18, 2024

change region_loss.py
294-297:
pred_boxes[0] = x.data.view(nBnAnHnW) + grid_x
pred_boxes[1] = y.data.view(nB
nAnHnW) + grid_y
pred_boxes[2] = torch.exp(w.data).view(nBnAnHnW) * anchor_w
pred_boxes[3] = torch.exp(h.data).view(nB
nAnHnW) * anchor_h

and this problem can be resolved

from fewshot_detection.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.