Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests are failing for RayEnvWorker #747

Closed
4 of 8 tasks
Markus28 opened this issue Sep 19, 2022 · 1 comment
Closed
4 of 8 tasks

Tests are failing for RayEnvWorker #747

Markus28 opened this issue Sep 19, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@Markus28
Copy link
Collaborator

  • I have marked all applicable categories:
    • exception-raising bug
    • RL algorithm bug
    • documentation request (i.e. "X is missing from the documentation.")
    • new feature request
  • I have visited the source website
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and environment, where applicable:

Running the unit tests on

Python 3.10.6 (main, Aug 2 2022, 00:00:00) [GCC 11.3.1 20220421 (Red Hat 11.3.1-2)] on linux

with ray 2.0.0, we get the following exception:

______________________________________________________________________________________________________________ test_async_env _______________________________________________________________________________________________________________

size = 10000, num = 8, sleep = 0.1

    def test_async_env(size=10000, num=8, sleep=0.1):
        # simplify the test case, just keep stepping
        env_fns = [
            lambda i=i: MyTestEnv(size=i, sleep=sleep, random_sleep=True)
            for i in range(size, size + num)
        ]
        test_cls = [SubprocVectorEnv, ShmemVectorEnv]
        if has_ray():
            test_cls += [RayVectorEnv]
        for cls in test_cls:
            v = cls(env_fns, wait_num=num // 2, timeout=1e-3)
>           v.seed(None)

test/base/test_env.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tianshou/env/venvs.py:329: in seed
    return [w.seed(s) for w, s in zip(self.workers, seed_list)]
tianshou/env/venvs.py:329: in <listcomp>
    return [w.seed(s) for w, s in zip(self.workers, seed_list)]
tianshou/env/worker/ray.py:66: in seed
    return ray.get(self.env.seed.remote(seed))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = Actor(_SetAttrWrapper, 6127ea1483717728cd9940b301000000), item = 'seed'

    def __getattr__(self, item):
        if not self._ray_is_cross_language:
>           raise AttributeError(
                f"'{type(self).__name__}' object has " f"no attribute '{item}'"
            )
E           AttributeError: 'ActorHandle' object has no attribute 'seed'

/home/markus/OpenSourceDev/venvs/tianshou_env/lib64/python3.10/site-packages/ray/actor.py:1184: AttributeError

The same issue persists with ray==1.13.0.

I haven't investigated this further, but could it be that

except NotImplementedError:
should handle an AttributeError instead?

@Markus28
Copy link
Collaborator Author

Is being fixed in #748

@Trinkle23897 Trinkle23897 added the bug Something isn't working label Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants