Closed CesMak closed 3 years ago
Seems like a bug. Can you provide a runnable repro script (the one above is not runnable due to from gameClasses import card, deck, player, game
).
Also, would be great to verify it also happens on the latest snapshot: https://ray.readthedocs.io/en/latest/installation.html
Hey there, yes same error happens even with
import gym, ray
from ray.rllib.agents import ppo
class WitchesEnv(gym.Env):
def __init__(self, env_config):
print("Inside InIT WITCHES ENV")
self.action_space = gym.spaces.Discrete(60)
self.observation_space = gym.spaces.Discrete(180)
def reset(self):
return None
def step(self, action):
return None#<obs>, <reward: float>, <done: bool>, <info: dict>
ray.init()
config = {
"lr": 0.01,
"num_workers": 0,
}
trainer = ppo.PPOTrainer(env=WitchesEnv, config= config)
#
# while True:
# print(trainer.train())
I installed it as follows:
pip install -U ray
Requirement already up-to-date: ray in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages
Requirement already up-to-date: grpcio in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Requirement already up-to-date: cloudpickle in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Requirement already up-to-date: click in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Requirement already up-to-date: pyyaml in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Requirement already up-to-date: redis>=3.3.2 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Requirement already up-to-date: funcsigs in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Requirement already up-to-date: google in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Collecting numpy>=1.16 (from ray)
Downloading https://files.pythonhosted.org/packages/07/08/a549ba8b061005bb629b76adc000f3caaaf881028b963c2e18f811c6edc1/numpy-1.18.2-cp36-cp36m-manylinux1_x86_64.whl (20.2MB)
100% |████████████████████████████████| 20.2MB 75kB/s
Requirement already up-to-date: py-spy>=0.2.0 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Requirement already up-to-date: pytest in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Requirement already up-to-date: protobuf>=3.8.0 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Requirement already up-to-date: jsonschema in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Requirement already up-to-date: colorama in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Requirement already up-to-date: packaging in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Requirement already up-to-date: filelock in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Requirement already up-to-date: six>=1.0.0 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Requirement already up-to-date: aiohttp in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from ray)
Requirement already up-to-date: beautifulsoup4 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from google->ray)
Requirement already up-to-date: pluggy<1.0,>=0.12 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from pytest->ray)
Requirement already up-to-date: wcwidth in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from pytest->ray)
Requirement already up-to-date: attrs>=17.4.0 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from pytest->ray)
Requirement already up-to-date: py>=1.5.0 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from pytest->ray)
Requirement already up-to-date: importlib-metadata>=0.12; python_version < "3.8" in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from pytest->ray)
Requirement already up-to-date: more-itertools>=4.0.0 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from pytest->ray)
Requirement already up-to-date: setuptools in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from protobuf>=3.8.0->ray)
Requirement already up-to-date: pyrsistent>=0.14.0 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from jsonschema->ray)
Requirement already up-to-date: pyparsing>=2.0.2 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from packaging->ray)
Requirement already up-to-date: chardet<4.0,>=2.0 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from aiohttp->ray)
Requirement already up-to-date: typing-extensions>=3.6.5; python_version < "3.7" in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from aiohttp->ray)
Requirement already up-to-date: async-timeout<4.0,>=3.0 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from aiohttp->ray)
Requirement already up-to-date: multidict<5.0,>=4.5 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from aiohttp->ray)
Requirement already up-to-date: idna-ssl>=1.0; python_version < "3.7" in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from aiohttp->ray)
Requirement already up-to-date: yarl<2.0,>=1.0 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from aiohttp->ray)
Requirement already up-to-date: soupsieve>=1.2 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from beautifulsoup4->google->ray)
Requirement already up-to-date: zipp>=0.5 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from importlib-metadata>=0.12; python_version < "3.8"->pytest->ray)
Requirement already up-to-date: idna>=2.0 in /home/markus/Documents/06_Software_Projects/mcts/mcts_env/lib/python3.6/site-packages (from idna-ssl>=1.0; python_version < "3.7"->aiohttp->ray)
Installing collected packages: numpy
Found existing installation: numpy 1.18.1
Uninstalling numpy-1.18.1:
Successfully uninstalled numpy-1.18.1
Successfully installed numpy-1.18.2
It works for me on both TF2.0 and 1.15. Maybe upgrade to 1.15?
I had similar issue on ray 0.8.2 with tf 1.14. It worked fine after downgrading ray to 0.8.1.
@pengmun How did you do that ? using pip?
I tried it with:
pip install https://ray-wheels.s3-us-west-2.amazonaws.com/master/{COMMIT_HASH}/ray-{RAY_VERSION}-{PYTHON_VERSION}-{PYTHON_VERSION}m-{OS_VERSION}_intel.whl
The commit from here:
pip install https://ray-wheels.s3-us-west-2.amazonaws.com/master/38ec2e7/ray-0.8.1-cp36-cp36m-manylinux1_x86_64.whl
pip install https://ray-wheels.s3-us-west-2.amazonaws.com/master/38ec2e70524a277d5aea307f6c843065ff982da5/ray-0.8.1-cp36-cp36m-manylinux1_x86_64.whl
but both failed: Not Found for url
@CesMak Yupe, I used pip to install the older version. You can do so by using the following commands.
pip install ray==0.8.1 pip install ray[debug]==0.8.1 pip install ray[tune]==0.8.1
Thanks that worked.
You can close this issue
Hi, I'm a bot from the Ray team :)
To help human contributors to focus on more relevant issues, I will automatically add the stale label to issues that have had no activity for more than 4 months.
If there is no further activity in the 14 days, the issue will be closed!
You can always ask for help on our discussion forum or Ray's public slack channel.
Hi again! The issue will be closed because there has been no more activity in the 14 days since the last message.
Please feel free to reopen or open a new issue if you'd still like it to be addressed.
Again, you can always ask for help on our discussion forum or Ray's public slack channel.
Thanks again for opening the issue!
Tensorflow fails initializing a trainer
I use rllib and have tensorflow (1.1.4) and pytorch installed in a python 3.6.9 environment. When initializing a trainer
trainer = ppo.PPOTrainer(env=WitchesEnv, config= config)
I get an Error.Error:
TypeError: Using a
tf.Tensoras a Python
boolis not allowed. Use
if t is not None:instead of
if t:to test if a tensor is defined, and use TensorFlow ops such as tf.cond to execute subgraphs conditioned on the value of a tensor.
Full Code
Full Error