diff --git a/docs/Installation.md b/docs/Installation.md index 3cbd976b21..dbaa271e83 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -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 diff --git a/ml-agents/mlagents/torch_utils/torch.py b/ml-agents/mlagents/torch_utils/torch.py index 24dc45cca3..ce1fec7a57 100644 --- a/ml-agents/mlagents/torch_utils/torch.py +++ b/ml-agents/mlagents/torch_utils/torch.py @@ -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}")