Giter Site home page Giter Site logo

Comments (6)

DrSleep avatar DrSleep commented on July 18, 2024 1

I did not run the models yet.

But I think I spotted the error: if you train using the script in this repo, then the model is being wrapped with nn.DataParallel - https://github.com/DrSleep/light-weight-refinenet/blob/master/src/train.py#L354
Now, when it happens, parameters' names in the state_dict have 'module.' before their original names.
In your inference script, you don't wrap the model with nn.DataParallel, hence the pre-trained weights are not actually loaded. You can see that by setting up strict=True

TL;DR in your inference script apply nn.DataParallel to your model before loading the weights.

from light-weight-refinenet.

DrSleep avatar DrSleep commented on July 18, 2024

that looks weird.

just to clarify: did you run the exactly same notebook code? and only changed the checkpoint file?
if so, I wonder if you can share the checkpoint file and the training log if possible.

from light-weight-refinenet.

st2yang avatar st2yang commented on July 18, 2024

Hi Vladimir,

Thanks for your reply.

Yes I run the code adapted from the notebook (mainly just copied and pasted). I can produce the right result figure with provided weights file. And I only changed the weights file then the result figure becomes horrible.

I packed related files (infer.py adapted from example notebook, training log and weights file) here https://drive.google.com/open?id=1SOf1CFudGdZ0Tf7OHASoBQu3ta22BJo-
can you please take a look?

Thanks a lot!

from light-weight-refinenet.

st2yang avatar st2yang commented on July 18, 2024

You're right. I made some mistakes in loading the weight file.

After fixing it, now I can get reasonably good prediction result (for ResNet50) as follows.

Thanks a lot for your help. I appreciate it a lot!

Screenshot from 2019-04-19 09-37-21

from light-weight-refinenet.

xiaoyuamw avatar xiaoyuamw commented on July 18, 2024

Hi@st2yang

Can you tell me what you had changed to solve you issue? and the link "https://drive.google.com/open?id=1SOf1CFudGdZ0Tf7OHASoBQu3ta22BJo-" provided by you can't to be opened now, so i also don't know what you have changed!
Thank you very much.

Best Regards.

from light-weight-refinenet.

st2yang avatar st2yang commented on July 18, 2024

@xiaoyuamw You can refer to Vladimir's response above or this repo https://github.com/choicelab/grasping-invisible.

As far I can remember, I just warp the model with nn. DataParallel

from light-weight-refinenet.

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.