ElegantRL icon indicating copy to clipboard operation
ElegantRL copied to clipboard

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

Open aymeric75 opened this issue 8 months ago • 1 comments

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 , 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

aymeric75 avatar Mar 03 '25 18:03 aymeric75