-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
if the framework is pytorch, it will from donkeycar.parts.pytorch.torch_train import train
and use it to train.
in this train function, it has following codes
if torch.cuda.is_available():
print('Using CUDA')
gpus = -1
else:
print('Not using CUDA')
gpus = 0
however, when creating the trainer, it uses cpu
flag and never use gpu
trainer = pl.Trainer(accelerator='cpu', logger=logger,
max_epochs=cfg.MAX_EPOCHS, default_root_dir=output_dir)
so I combined them and can use gpus successfully
if torch.cuda.is_available():
print('Using CUDA')
trainer = pl.Trainer(accelerator='gpu', devices=-1, logger=logger,
max_epochs=cfg.MAX_EPOCHS, default_root_dir=output_dir)
else:
print('Not using CUDA')
trainer = pl.Trainer(accelerator='cpu', logger=logger,
max_epochs=cfg.MAX_EPOCHS, default_root_dir=output_dir)
If it serves no other purpose, I think it's a bug
Metadata
Metadata
Assignees
Labels
No labels