Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🐛 [Fix] for setting multigpu, enable pick cuda id
  • Loading branch information
henrytsui000 committed Dec 30, 2025
commit 3e7dd7d064ac7eb8286f35e70b185c3341cc2131
1 change: 1 addition & 0 deletions yolo/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class Config:
model: ModelConfig
name: str

accelerator: Optional[str]
device: Union[str, int, List[int]]
cpu_num: int

Expand Down
1 change: 1 addition & 0 deletions yolo/config/general.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
accelerator: auto
device: 0
cpu_num: 16

Expand Down
4 changes: 3 additions & 1 deletion yolo/lazy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ def main(cfg: Config):
callbacks, loggers, save_path = setup(cfg)

trainer = Trainer(
accelerator="auto",
accelerator=getattr(cfg, "accelerator", "auto"),
devices=cfg.device,
max_epochs=getattr(cfg.task, "epoch", None),
precision="16-mixed",
callbacks=callbacks,
sync_batchnorm=True,
logger=loggers,
log_every_n_steps=1,
gradient_clip_val=10,
Expand Down