AI4Finance-Foundation / AI4Finance-Foundation/ElegantRL

Discrepancy in train/run.py produces TypeError: '>=' not supported between instances of 'list' and 'int' error

Offen
#472 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
4.4k
Forks
978
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi,

In my quest to understand how the code works, I noticed in the _run_ function of the _PipeWorker_ class, this line:

`gpu_id = args.learner_gpus`

But _args.learner_gpus_ seems to be a list of IDs, where gpu_id a single ID.

And indeed when running the [code ](https://elegantrl.readthedocs.io/en/latest/tutorial/elegantrl-podracer.html), I get the error

```
File "/workspace/elegantrl/agents/AgentBase.py", line 45, in __init__
self.device = torch.device(f"cuda:{gpu_id}" if (torch.cuda.is_available() and (gpu_id >= 0)) else "cpu")
TypeError: '>=' not supported between instances of 'list' and 'int'
```
Thanks for your help

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.