Error RandomNumberGenerator

How severe does this issue affect your experience of using Ray?

  • High: It blocks me to complete my task.

Hi, after updating to Python 3.10.9, I am getting a strange error from Ray:

Traceback (most recent call last):
  File "c:\Users\Ardij\Projekte\marl-warsim\", line 179, in <module>
    algo = ppo.PPO(env=DogfightScenario, config=config)
  File "C:\Users\Ardij\Projekte\marl-warsim\venv\lib\site-packages\ray\rllib\algorithms\", line 441, in __init__
  File "C:\Users\Ardij\Projekte\marl-warsim\venv\lib\site-packages\ray\tune\trainable\", line 169, in __init__
  File "C:\Users\Ardij\Projekte\marl-warsim\venv\lib\site-packages\ray\rllib\algorithms\", line 566, in setup
    self.workers = WorkerSet(
  File "C:\Users\Ardij\Projekte\marl-warsim\venv\lib\site-packages\ray\rllib\evaluation\", line 169, in __init__
  File "C:\Users\Ardij\Projekte\marl-warsim\venv\lib\site-packages\ray\rllib\evaluation\", line 253, in _setup
    spaces = self._get_spaces_from_remote_worker()
  File "C:\Users\Ardij\Projekte\marl-warsim\venv\lib\site-packages\ray\rllib\evaluation\", line 279, in _get_spaces_from_remote_worker
    remote_spaces = self.foreach_worker(
  File "C:\Users\Ardij\Projekte\marl-warsim\venv\lib\site-packages\ray\rllib\evaluation\", line 696, in foreach_worker
    handle_remote_call_result_errors(remote_results, self._ignore_worker_failures)
  File "C:\Users\Ardij\Projekte\marl-warsim\venv\lib\site-packages\ray\rllib\evaluation\", line 73, in handle_remote_call_result_errors
    raise r.get()
  File "C:\Users\Ardij\Projekte\marl-warsim\venv\lib\site-packages\ray\rllib\utils\", line 473, in __fetch_result
    result = ray.get(r)
  File "C:\Users\Ardij\Projekte\marl-warsim\venv\lib\site-packages\ray\_private\", line 105, in wrapper
    return func(*args, **kwargs)
  File "C:\Users\Ardij\Projekte\marl-warsim\venv\lib\site-packages\ray\_private\", line 2311, in get
    raise value
ray.exceptions.RaySystemError: System error: RandomNumberGenerator._generator_ctor() takes from 0 to 1 positional arguments but 2 were given      
traceback: Traceback (most recent call last):
  File "C:\Users\Ardij\Projekte\marl-warsim\venv\lib\site-packages\ray\_private\", line 369, in deserialize_objects
    obj = self._deserialize_object(data, metadata, object_ref)
  File "C:\Users\Ardij\Projekte\marl-warsim\venv\lib\site-packages\ray\_private\", line 252, in _deserialize_object
    return self._deserialize_msgpack_data(data, metadata_fields)
  File "C:\Users\Ardij\Projekte\marl-warsim\venv\lib\site-packages\ray\_private\", line 207, in _deserialize_msgpack_data
    python_objects = self._deserialize_pickle5_data(pickle5_data)
  File "C:\Users\Ardij\Projekte\marl-warsim\venv\lib\site-packages\ray\_private\", line 195, in _deserialize_pickle5_data
    obj = pickle.loads(in_band, buffers=buffers)
TypeError: RandomNumberGenerator._generator_ctor() takes from 0 to 1 positional arguments but 2 were given

What I am training is a multi-agent reinforcement learning algorithm with a custom env, which works smoothly on Python 3.10.6 on my other laptop. Ray version is 2.2.0. This is currently on Windows and I know that ray is in beta version for Windows. But I had the exact same behaviour in Linux when I updated.

Do you have any suggestions, or will there be an update about this?

Thanks, Ardian

For those coming across this post, I found the solution according to previous and same problems here

It is just to downgrade numpy to version 1.23.5 and it works again :slight_smile:

(strange that I found those posts on Github only after I made my own question here, but I let it for others to see)