Git Product home page Git Product logo

Comments (7)

jimmyyhwu avatar jimmyyhwu commented on August 12, 2024

Where is the test.py file you are running? I'm looking at line 164 of generate_unitsegments.py and it's not the same.

from ddsm-visual-primitives.

danieltao avatar danieltao commented on August 12, 2024

The test.py is just generate_unitsegments.py with a different name. I added some print statements try to debug myself so the number might not be correct. The error occurs everytime I run model(input). I have also checked input shape, which is (32, 3,227,227), which looks correct.

from ddsm-visual-primitives.

jimmyyhwu avatar jimmyyhwu commented on August 12, 2024

Hmm, could you attach your test.py file, and also the .../virtual_envs/ML/lib/python3.5/site-packages/torchvision/models/resnet.py file?

from ddsm-visual-primitives.

danieltao avatar danieltao commented on August 12, 2024

Yes, of course.
test.py.txt
resnet.py.txt

from ddsm-visual-primitives.

danieltao avatar danieltao commented on August 12, 2024

I changed the image size to 224,224 and fixed the issue. I also added a resize line in DDSM transforms.

from ddsm-visual-primitives.

jimmyyhwu avatar jimmyyhwu commented on August 12, 2024

Okay, sounds good. Please note though that resizing the image to 224x224 from 227x227 will produce different outputs and lower AUC numbers than reported in the paper, since the resizing blurs the image.

If you are curious why you were getting the original error, it is because the torchvision resnet was changed in newer versions. I took a look at your resnet.py and it is the newer version. In particular, nn.AvgPool2d(7) was changed to nn.AvgPool2d(7, stride=1) in this commit.

If you install torchvision 0.1.9, the error should go away and the code should work as-is. This pitfall was described in the README.

from ddsm-visual-primitives.

bintykhany avatar bintykhany commented on August 12, 2024

Yes, of course.
test.py.txt
resnet.py.txt

can you share full code?

from ddsm-visual-primitives.

Related Issues (3)

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.