GithubHelp home page GithubHelp logo

How to change the GPU device? about pointr HOT 11 CLOSED

yuxumin avatar yuxumin commented on August 23, 2024
How to change the GPU device?

from pointr.

Comments (11)

yuxumin avatar yuxumin commented on August 23, 2024

Use the following command to train a model with GPU:1

bash ./scripts/train.sh 1 --config <config> 

from pointr.

whuhxb avatar whuhxb commented on August 23, 2024

@yuxumin OK. Thanks. But when I change into GPU:1, I still met the OOM when running the command: bash ./scripts/train.sh 2 --config ./cfgs/PCN_models/GRNet.yaml --exp_name example

init.py", line 22, in forward
min_x, max_x, min_y, max_y, min_z, max_z, gt_cloud)
RuntimeError: CUDA out of memory. Tried to allocate 512.00 MiB (GPU 0; 31.75 GiB total capacity; 29.93 GiB already allocated; 451.50 MiB free; 29.99 GiB reserved in total by PyTorch)

It seems that the code still run on GPU: 0 ? I'm not sure.

from pointr.

yuxumin avatar yuxumin commented on August 23, 2024

It seems that the code still run on GPU: 0 ? I'm not sure.

The code in train.sh is CUDA_VISIBLE_DEVICES=${GPUS} python main.py ${PY_ARGS}. I am sure that the code run on GPU:1

bash ./scripts/train.sh 2 --config ./cfgs/PCN_models/GRNet.yaml --exp_name example

And this will put the model and data on GPU:2

from pointr.

whuhxb avatar whuhxb commented on August 23, 2024

@yuxumin OK. I see. I try to run other GPU Cluster nodes, but I met an error like this:

anaconda3/envs/pytorch-PoinTr/lib/python3.7/site-packages/knn_cuda/init.py", line 15, in load_cpp_ext
assert torch.cuda.is_available(), "torch.cuda.is_available() is False."
AssertionError: torch.cuda.is_available() is False.

I use cuda11.1 and pytorch==1.8.0, it seems that the GPU is not available now.

from pointr.

whuhxb avatar whuhxb commented on August 23, 2024

@yuxumin Which file to change batchsize of GRNet.yaml and TopNet.yaml?

from pointr.

yuxumin avatar yuxumin commented on August 23, 2024

bash ./scripts/train.sh 2 --config ./cfgs/PCN_models/GRNet.yaml --exp_name example

This code means to use the config file in cfgs/PCN_models/GRNet.yaml

from pointr.

whuhxb avatar whuhxb commented on August 23, 2024

@yuxumin Is this: total_bs : 32 in cfgs/PCN_models/GRNet.yaml to change the batch size, right?

from pointr.

yuxumin avatar yuxumin commented on August 23, 2024

yes

from pointr.

whuhxb avatar whuhxb commented on August 23, 2024

@yuxumin I have change it into 2, the OOM still occurs.

from pointr.

yuxumin avatar yuxumin commented on August 23, 2024

GRNet requires to calculate gridding loss during the training, which takes a lot of memory of GPU. Can you try to train other models, rather than GRNet

from pointr.

yuxumin avatar yuxumin commented on August 23, 2024

Close it since no response. Feel free to re-open it if problems still exist

from pointr.

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.