diff --git a/rllib/core/learner/training_data.py b/rllib/core/learner/training_data.py index dc2bb1bd3271..6d178539894a 100644 --- a/rllib/core/learner/training_data.py +++ b/rllib/core/learner/training_data.py @@ -132,8 +132,10 @@ def solve_refs(self): for ref in episode_refs: try: episodes.extend(ray.get(ref)) - except ray.exceptions.OwnerDiedError: - pass + except ray.exceptions.OwnerDiedError as e: + ray.logger.warning( + f"episode-ref {ref} died and can't be collected with error: {e}. This can happen if an EnvRunner is lost (for example because of a node failure) and is not critical in such cases." + ) self.episodes = episodes self.episodes_refs = None diff --git a/rllib/core/rl_module/rl_module.py b/rllib/core/rl_module/rl_module.py index 7e63c9cd9662..dce204155f01 100644 --- a/rllib/core/rl_module/rl_module.py +++ b/rllib/core/rl_module/rl_module.py @@ -485,6 +485,8 @@ def __init__( except AttributeError as e: if "'NoneType' object has no attribute " in e.args[0]: raise (self._catalog_ctor_error or e) + raise e + self._is_setup = True # Cache value for returning from `is_stateful` so we don't have to call # the module's `get_initial_state()` method all the time (might be expensive). diff --git a/rllib/env/env_runner_group.py b/rllib/env/env_runner_group.py index 83203907b09f..0bbe989b3ece 100644 --- a/rllib/env/env_runner_group.py +++ b/rllib/env/env_runner_group.py @@ -1282,9 +1282,8 @@ def _make_worker( .remote(**kwargs) ) - @classmethod - def _valid_module(cls, class_path): - del cls + @staticmethod + def _valid_module(class_path): if ( isinstance(class_path, str) and not os.path.isfile(class_path) @@ -1295,9 +1294,8 @@ def _valid_module(cls, class_path): spec = importlib.util.find_spec(module_path) if spec is not None: return True - except (ModuleNotFoundError, ValueError): - print( - f"module {module_path} not found while trying to get " - f"input {class_path}" + except (ModuleNotFoundError, ValueError) as e: + logger.warning( + f"module {module_path} not found using input {class_path} with error: {e}" ) return False