Code Monkey home page Code Monkey logo

Comments (8)

eroshacinas avatar eroshacinas commented on July 1, 2024 1

os.environ['CUDA_VISIBLE_DEVICES'] = "1"

This solved it, thank you!

from super-gradients.

Louis-Dupont avatar Louis-Dupont commented on July 1, 2024 1

Already tried, but it's giving me a KeyError: "Trainer does not accept anymore 'device' and 'multi_gpu' as argument. Both should instead be passed to super_gradients.setup_device(device=..., multi_gpu=..., num_gpus=...)"

Trainer(device=...) is legacy and will soon be removed from SG.

The same can be done with

from super_gradients.training.utils.distributed_training_utils import setup_device

setup_device(device=...)

But this is only useful if you want to train on cpu, or with multiple gpus (DP/DDP). The default behavior is single GPU so you don't need to call it in your case

from super-gradients.

dagshub avatar dagshub commented on July 1, 2024

Join the discussion on DagsHub!

from super-gradients.

BloodAxe avatar BloodAxe commented on July 1, 2024

export CUDA_VISIBLE_DEVICES=0 python -m super_gradients.train_from_recipe ...

from super-gradients.

eroshacinas avatar eroshacinas commented on July 1, 2024

Hi. Is there a way to do it without using a recipe or through trainer.train?

from super-gradients.

BloodAxe avatar BloodAxe commented on July 1, 2024

You can always pass target device to instance of Trainer manually if you want:
trainer = Trainer(..., device = "cuda:1")

from super-gradients.

eroshacinas avatar eroshacinas commented on July 1, 2024

Already tried, but it's giving me a KeyError: "Trainer does not accept anymore 'device' and 'multi_gpu' as argument. Both should instead be passed to super_gradients.setup_device(device=..., multi_gpu=..., num_gpus=...)"

from super-gradients.

Louis-Dupont avatar Louis-Dupont commented on July 1, 2024

You can set it with env variables at the beginning of your script

import os
from super_gradients import Trainer

os.environ['CUDA_VISIBLE_DEVICES'] = "1"


# Unchanged
trainer = Trainer(...)
trainer.train(...)

from super-gradients.

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.