How severe does this issue affect your experience of using Ray?
- Medium: It contributes to significant difficulty to complete my task, but I can work around it.
I’m trying to train a policy against a fixed heuristic policy in a custom environment, but I keep running into this failed to unpickle serialized exception error. I’m having trouble understanding where the error stems from - the traceback doesn’t seem to touch any function that I’ve written. Has anyone seen this kind of error before?
System Details:
Windows
Ray 2.3
Tensorflow 2.12
Config:
config = R2D2Config()
config.environment(env=“HierInfoInspEnv”, env_config=my_env_config, normalize_actions=False)
config.replay_buffer_config.update({“type”: “MultiAgentReplayBuffer”,“capacity”: 10000, “max_seq_len”: 10, “replay_burn_in”: 5})
config.training(gamma=0.95, train_batch_size=256)
config.rollouts(num_rollout_workers=1)
policy_map = {
“planner_0”: PolicySpec(observation_space=obs_space_high, action_space=act_space_high, config=
{“model”: {“fcnet_hiddens”: [256, 256], “fcnet_activation”: “tanh”,
“use_lstm”: True,
“lstm_cell_size”: 256}}),
“planner_1”: PolicySpec(observation_space=obs_space_high, action_space=act_space_high, config=
{“model”: {“fcnet_hiddens”: [256, 256], “fcnet_activation”: “tanh”,
“use_lstm”: True,
“lstm_cell_size”: 256}}),
“planner_2”: PolicySpec(observation_space=obs_space_high, action_space=act_space_high, config=
{“model”: {“fcnet_hiddens”: [256, 256], “fcnet_activation”: “tanh”,
“use_lstm”: True,
“lstm_cell_size”: 256}}),
“deputy_0”: PolicySpec(policy_class=OptimizationLLController, observation_space=obs_space_low,
action_space=act_space_low, config={}),
“deputy_1”: PolicySpec(policy_class=OptimizationLLController, observation_space=obs_space_low,
action_space=act_space_low, config={}),
“deputy_2”: PolicySpec(policy_class=OptimizationLLController, observation_space=obs_space_low,
action_space=act_space_low, config={})
}
config.multi_agent(policies=policy_map, policy_mapping_fn=select_policy,
policies_to_train=[“planner_0”, “planner_1”, “planner_2”])
config.debugging(log_level=“WARN”)
Traceback:
Traceback (most recent call last):
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\tune\execution\ray_trial_executor.py”, line 1276, in get_next_executor_event
future_result = ray.get(ready_future)
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray_private\client_mode_hook.py”, line 105, in wrapper
return func(*args, **kwargs)
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray_private\worker.py”, line 2380, in get
raise value.as_instanceof_cause()
ray.exceptions.RayTaskError: ray::R2D2.train() (pid=25180, ip=127.0.0.1, repr=R2D2)
File “python\ray_raylet.pyx”, line 857, in ray._raylet.execute_task
File “python\ray_raylet.pyx”, line 861, in ray._raylet.execute_task
File “python\ray_raylet.pyx”, line 803, in ray._raylet.execute_task.function_executor
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray_private\function_manager.py”, line 674, in actor_method_executor
return method(__ray_actor, *args, **kwargs)
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\util\tracing\tracing_helper.py”, line 466, in _resume_span
return method(self, *_args, **_kwargs)
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\tune\trainable\trainable.py”, line 368, in train
raise skipped from exception_cause(skipped)
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\tune\trainable\trainable.py”, line 365, in train
result = self.step()
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\util\tracing\tracing_helper.py”, line 466, in _resume_span
return method(self, *_args, **_kwargs)
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\rllib\algorithms\algorithm.py”, line 782, in step
results, train_iter_ctx = self._run_one_training_iteration()
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\util\tracing\tracing_helper.py”, line 466, in _resume_span
return method(self, *_args, **_kwargs)
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\rllib\algorithms\algorithm.py”, line 2713, in _run_one_training_iteration
results = self.training_step()
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\util\tracing\tracing_helper.py”, line 466, in _resume_span
return method(self, *_args, **_kwargs)
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\rllib\algorithms\dqn\dqn.py”, line 405, in training_step
new_sample_batch = synchronous_parallel_sample(
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\rllib\execution\rollout_ops.py”, line 85, in synchronous_parallel_sample
sample_batches = worker_set.foreach_worker(
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\rllib\evaluation\worker_set.py”, line 701, in foreach_worker
handle_remote_call_result_errors(remote_results, self._ignore_worker_failures)
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\rllib\evaluation\worker_set.py”, line 74, in handle_remote_call_result_errors
raise r.get()
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\rllib\utils\actor_manager.py”, line 477, in __fetch_result
result = ray.get(r)
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray_private\client_mode_hook.py”, line 105, in wrapper
return func(*args, **kwargs)
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray_private\worker.py”, line 2382, in get
raise value
ray.exceptions.RaySystemError: System error: Failed to unpickle serialized exception
traceback: Traceback (most recent call last):
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\exceptions.py”, line 46, in from_ray_exception
return pickle.loads(ray_exception.serialized_exception)
AttributeError: type object ‘_DTypeMeta’ has no attribute ‘type’
The above exception was the direct cause of the following exception:
ray::R2D2.train() (pid=25180, ip=127.0.0.1, repr=R2D2)
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray_private\serialization.py”, line 369, in deserialize_objects
obj = self._deserialize_object(data, metadata, object_ref)
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray_private\serialization.py”, line 275, in _deserialize_object
return RayError.from_bytes(obj)
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\exceptions.py”, line 40, in from_bytes
return RayError.from_ray_exception(ray_exception)
File “C:\Users\henry.lei\Miniconda3\envs\InfoInspEnv-ray-2.3.0\lib\site-packages\ray\exceptions.py”, line 49, in from_ray_exception
raise RuntimeError(msg) from e
RuntimeError: Failed to unpickle serialized exception
Thanks!