Giter VIP home page Giter VIP logo

Comments (4)

ymq2017 avatar ymq2017 commented on July 28, 2024

Hi, the evaluation script in the train folder is
python -m torch.distributed.launch --nproc_per_node=1 train.py --checkpoint ./pretrained_checkpoint/sam_vit_l_0b3195.pth --model-type vit_l --output work_dirs/hq_sam_l --eval --restore-model work_dirs/hq_sam_l/epoch_11.pth
In this script, we load sam_vit_l_0b3195.pth for the encoder output and load the additional parameters trained by ours with the argument --restore-model. In training, we only learn a small number of parameters and save them. For evaluation on HQ dataset, we only need to load this group of parameters.
An example checkpoint for --restore-model can be found here. You can also train it yourself.

from sam-hq.

ankitgoyalumd avatar ankitgoyalumd commented on July 28, 2024

from sam-hq.

ymq2017 avatar ymq2017 commented on July 28, 2024

Hi, when evaluating the four HQ datasets, we only need to load the mask_decoder of hq_sam. We do it this way because it saves storage space during training. For example,
--restore-model work_dirs/hq_sam_l/epoch_11.pth
Here epoch_11.pth is the decoder part of the sam_hq_vit_l.pth. An example checkpoint for --restore-model can be found in this link. You can also train it yourself.

from sam-hq.

vishakhalall avatar vishakhalall commented on July 28, 2024

I faced this error too. I used the command python3 -m torch.distributed.launch --nproc_per_node=1 train.py --checkpoint ./pretrained_checkpoint/sam_vit_l_0b3195.pth --model-type vit_l --output work_dirs/hq_sam_l/ --eval --restore-model work_dirs/hq_sam_l/sam_hq_epoch_11.pth where sam_hq_epoch_11.pth was the final checkpoint that the training had saved. However when I tried with any other previous checkpoints, it worked as expected.

from sam-hq.

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.