AI4Finance-Foundation / AI4Finance-Foundation/ElegantRL

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

Ouverte
#472 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
4.4k
Forks
978
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.