Coder Social home page Coder Social logo

Comments (4)

fcdl94 avatar fcdl94 commented on August 30, 2024 1

Oh sure, sorry!

So, basically you can have a script similar to this:

model = torch.load("the checkpoint path")
state = {}
for k, v in checkpoint.items():
state[k[7:]] = v
torch.save(state, "the destination path")

The destination path should be something like pretrained/{opts.backbone}_{opts.norm_act}.pth.tar and it'll be automatically loaded by the code.

Hope it's clearer now :)

from mib.

houxushi avatar houxushi commented on August 30, 2024 1

Oh sure, sorry!

So, basically you can have a script similar to this:

model = torch.load("the checkpoint path")
state = {}
for k, v in checkpoint.items():
state[k[7:]] = v
torch.save(state, "the destination path")

The destination path should be something like pretrained/{opts.backbone}_{opts.norm_act}.pth.tar and it'll be automatically loaded by the code.

Hope it's clearer now :)

Thank you very much for taking the time to answer my question!I will study your reply carefully, good luck!:)

from mib.

fcdl94 avatar fcdl94 commented on August 30, 2024

We used the pretrained model released by the authors of In-place ABN (as said in the paper), that can be found in their GitHub project: https://github.com/mapillary/inplace_abn.

Since the pretrained are made on multiple-gpus, they contain a prefix "module." in each key of the network. Please, be sure to remove them to be compatible with this code (simply rename them using key = key[7:]). If you don't want to use pretrained, please use --no-pretrained.

from mib.

houxushi avatar houxushi commented on August 30, 2024

We used the pretrained model released by the authors of In-place ABN (as said in the paper), that can be found in their GitHub project: https://github.com/mapillary/inplace_abn.

Since the pretrained are made on multiple-gpus, they contain a prefix "module." in each key of the network. Please, be sure to remove them to be compatible with this code (simply rename them using key = key[7:]). If you don't want to use pretrained, please use --no-pretrained.

this "module" and key I don't understand and I don't know how to change it in this code,could you tell me the detail?how can I rename them,this"key = key[7:]"I don't know how to apply them,Sorry to disturb you

from mib.

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.