mlco2 / codecarbon

Track emissions from Compute and recommend ways to reduce their impact on the environment.
https://mlco2.github.io/codecarbon
MIT License
1k stars 157 forks source link

fix: warning invalid gpus format #560

Closed inimaz closed 1 month ago

inimaz commented 1 month ago

Closes #557 Goal is to log the warning only if gpu_ids is defined.

Logs before this PR

[codecarbon INFO @ 21:24:39] offline tracker init
[codecarbon WARNING @ 21:24:39] Invalid gpu_ids format. Expected a string or a list of ints.
[codecarbon INFO @ 21:24:39] [setup] RAM Tracking...
[codecarbon INFO @ 21:24:39] [setup] GPU Tracking...
[codecarbon INFO @ 21:24:39] Tracking Nvidia GPU via pynvml
...

Logs after this PR

[codecarbon INFO @ 21:19:24] offline tracker init
[codecarbon INFO @ 21:19:24] [setup] RAM Tracking...
[codecarbon INFO @ 21:19:24] [setup] GPU Tracking...
...