Skip to content

Commit

Permalink
Fixed pytorch deprecation message during training startup. Updated In…
Browse files Browse the repository at this point in the history
…stallation.md
  • Loading branch information
miguelalonsojr committed Aug 25, 2024
1 parent 3971bd6 commit 120e2e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The ML-Agents Toolkit contains several components:
Consequently, to install and use the ML-Agents Toolkit you will need to:

- Install Unity (2023.2 or later)
- Install Python (3.10.12 or higher)
- Install Python (>= 3.10.1, <=3.10.12) - we recommend using 3.10.12
- Clone this repository (Recommended for the latest version and bug fixes)
- __Note:__ If you do not clone the repository, then you will not be
able to access the example environments and training configurations or the
Expand Down
5 changes: 3 additions & 2 deletions ml-agents/mlagents/torch_utils/torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ def set_torch_config(torch_settings: TorchSettings) -> None:
_device = torch.device(device_str)

if _device.type == "cuda":
torch.set_default_tensor_type(torch.cuda.FloatTensor)
torch.set_default_device(_device.type)
torch.set_default_dtype(torch.cuda.FloatTensor)
else:
torch.set_default_tensor_type(torch.FloatTensor)
torch.set_default_dtype(torch.float32)
logger.debug(f"default Torch device: {_device}")


Expand Down

0 comments on commit 120e2e9

Please sign in to comment.