Git Product home page Git Product logo

Comments (3)

AbanoubMamdouh avatar AbanoubMamdouh commented on May 18, 2024 5

@harpalsahota The most important thing is that the input image dimensions which you resize in the function:

get_test_input()

matches with the dimensions of the image in the cfg file. I've tried it myself and it worked fine.

from yolo_v3_tutorial_from_scratch.

harpalsahota avatar harpalsahota commented on May 18, 2024 2

Got a similar error, but mine is happens in the predict_transform method, when calling prediction.view

RuntimeError: shape '[1, 255, 3025]' is invalid for input of size 689520

Printing the inputs to prediction.view I get:

batch_size, bbox_attrs, num_anchors, grid_size
1 85 3 13
1 85 3 26
1 85 3 55 <--- crashes here

from yolo_v3_tutorial_from_scratch.

harpalsahota avatar harpalsahota commented on May 18, 2024 1

I think the issue is in the cfg file. The original height and width was 416 but now is 608. So

stride = in_dim // prediction.size(2)

went from 416 // 52 = 8 to 608 // 52 = 11. Therefore:

grid_size = in_dim // stride

went from 416 // 8 = 52 to 608 // 11 = 55. The latter has the incorrect grid size this causing the shape error here:

prediction = prediction.view(batch_size, bbox_attrs * num_anchors, grid_size * grid_size)

Would the correct thing to do be changing the height and width back to 416?

from yolo_v3_tutorial_from_scratch.

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.