Skip to content

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

@aymeric75

Description

@aymeric75

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions