huggingface / huggingface/deep-rl-class

[HANDS-ON BUG] mlagents-learn in unit 5 not working

Open
#571 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
MDX
Stars
5k
Forks
811
PR merge metrics
No merged PRs in 30d

Description

# Describe the bug

The command

`!mlagents-learn ./config/ppo/SnowballTarget.yaml --env=./training-envs-executables/linux/SnowballTarget/SnowballTarget --run-id="SnowballTarget1" --no-graphics`

doesnt work.
It always results in the following error:

`RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument mat1 in method wrapper_CUDA_addmm)`.

I have tried specifying the device with the `--torch-device` argument but that didnt help either.
Maybe this has something to do with the fact that dev versions are used for the ml-agents and ml-agents-envs packages?

```
ml-agents: 1.2.0.dev0,
ml-agents-envs: 1.2.0.dev0,
Communicator API: 1.5.0,
PyTorch: 2.5.0+cu121
```

# Material

- Did you use Google Colab?
Yes

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.