Giter Site home page Giter Site logo

Comments (3)

DrSleep avatar DrSleep commented on July 18, 2024

You first need to define the model you trained (i.e. MBv2, or RF-LW-50/101/152) with the appropriate number of classes.
In the notebook I show how to do it for each network, using this: net = fun(n_classes, pretrained=True).eval().cuda().

You should replace fun with the appropriate network function and set pretrained=False
Then you need to load the checkpoint file, e.g. via ckpt = torch.load(checkpoint)
If you trained your model with GPU, then you will need to do net = nn.DataParallel(net) before restoring the state dict net.load_state_dict(ckpt["model"]) (if you were not training with GPU, you can just skip the first step)

You can also see how I am loading the checkpoint here:

def setup_checkpoint_and_maybe_restore(args, model, optimisers, schedulers):

from light-weight-refinenet.

hyclover avatar hyclover commented on July 18, 2024

Thanks for your reply! I have achieved it successfully according to your guidance.

from light-weight-refinenet.

DrSleep avatar DrSleep commented on July 18, 2024

Marking it as resolved

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.