Giter Site home page Giter Site logo

Comments (5)

bermanmaxim avatar bermanmaxim commented on May 21, 2024 1

There are ways to load GPU weights to CPU only (changing device) with torch.load, have a look at:
https://discuss.pytorch.org/t/loading-weights-for-cpu-model-while-trained-on-gpu/1032

from superpoint_graph.

loicland avatar loicland commented on May 21, 2024

Hi,

first you need to set the option --cuda to 0. But yes, the trained weights are only compatible with cuda, and you will need to retrain the model from scratch. It takes about 3 hours on my 1080. I haven't tried without CPUs, but it might take a while.

from superpoint_graph.

amandaloh16 avatar amandaloh16 commented on May 21, 2024

If i already have a model.pth.tar file, I don't need a GPU computer to semantically segment new test data correct? What is the correct command line arg to do that? Is this correct? Say I have a folder of new data to label in NewClouds

CUDA_VISIBLE_DEVICES=0 python learning/main.py --cuda 0 --dataset sema3d --SEMA3D_PATH $SEMA3D_DIR --db_test_name NewClouds --db_train_name train
--epochs -1 --lr_steps '[350, 400, 450]' --test_nth_epoch 100 --model_config 'gru_10,f_8' --ptn_nfeat_stn 11
--nworkers 2 --odir "results/sema3d/trainval_best" --resume

from superpoint_graph.

loicland avatar loicland commented on May 21, 2024

Hi,

sorry a bit late to the party, but the link sent by @bermanmaxim works.

the simplest way would be to add:

if not args.cuda:
        model = model.cpu()

in the function resume

from superpoint_graph.

mys007 avatar mys007 commented on May 21, 2024

Hi, this should also work and allows you to load the model even if you have no cuda at all:

checkpoint = torch.load(args.resume, map_location=None if args.cuda else 'cpu')

from superpoint_graph.

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.