ray-project / ray

Ray is an AI compute engine. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
https://ray.io
Apache License 2.0
34.14k stars 5.8k forks source link

[docs] RLlib ImportError Issue on page /rllib/rllib-training.html #35491

Closed I3lacx closed 1 year ago

I3lacx commented 1 year ago

Following the installation on the Getting started page. Starting with a clean python 3.8.16 anaconda environment on Windows 10, following these steps:

pip install "ray[rllib]" tensorflow
rllib train --algo DQN --env CartPole-v1

Causes a missing Module Error: ModuleNotFoundError: No module named 'tensorflow_probability'

This should be solved in the future through #34756

Running pip install tensorflow-probability temporarily solved the missing dependency Running the command again, resulted in a different import error:

ImportError: PyTorch was specified as the framework to use (via `config.framework('torch')`)! However, no installation was found. You can install PyTorch via `pip install torch`

Thus adding the framework to the command, correctly started the training:

rllib train --algo DQN --env CartPole-v1 --framework tf2

So either installing torch instead of tensorflow or specifying the framework as tf2 should be a sufficient update for the tutorial.

Note: I purposely removed the --stop '{"training_iteration": 30}' part of the command, as it causes issues on cmd and powershell (#35492) I am also very new to writing issues and using rllib, so please correct me if I made any mistakes.

Rohan138 commented 1 year ago

Thanks for the issue! #34756 should close the problem with tf2, and we recently changed the default framework from tf2 to torch, which caused the second error. We'll update the tutorial accordingly.