Giter Club home page Giter Club logo

Comments (8)

vmoens avatar vmoens commented on June 26, 2024 1

Cc @albertbou92

from rl.

albertbou92 avatar albertbou92 commented on June 26, 2024 1

I am able to reproduce the bug. Let me look into it.

from rl.

albertbou92 avatar albertbou92 commented on June 26, 2024 1

I have been further able to reproduce the bug with some code that does not involve TorchRL. TorchRL collectors inherit from IterableDataset, which apparently with this python version raises the bug when calling ray.remote.

import ray
from torch.utils.data import IterableDataset


class SyncDataCollector(IterableDataset):
    def __iter__(self):
        return


ray.init()
ray.remote(SyncDataCollector)

Digging a bit more seems related to the way ray handles classes to turn them to remote classes
https://github.com/ray-project/ray/blob/master/python/ray/actor.py#L1606C13-L1606C26
I have opened an issue for now

from rl.

albertbou92 avatar albertbou92 commented on June 26, 2024 1

ray-project/ray#42914

from rl.

sergiovalmac avatar sergiovalmac commented on June 26, 2024

I tried with python 3.8 and I don't get the GenericAlias issue, but I got a different error:

2024-02-12 20:29:01,299 INFO worker.py:1724 -- Started a local Ray instance.
Traceback (most recent call last):
  File "sample_envs.py", line 55, in <module>
    distributed_collector = RayCollector(
  File "3.8_torchrl\lib\site-packages\torchrl\collectors\distributed\ray.py", line 475, in __init__
    ray.wait(object_refs=pending_samples)
  File "3.8_torchrl\lib\site-packages\ray\_private\auto_init_hook.py", line 22, in auto_init_wrapper
    return fn(*args, **kwargs)
  File "3.8_torchrl\lib\site-packages\ray\_private\client_mode_hook.py", line 103, in wrapper
    return func(*args, **kwargs)
TypeError: wait() got an unexpected keyword argument 'object_refs'

from rl.

albertbou92 avatar albertbou92 commented on June 26, 2024

I was able to reproduce the error. Ray changed the signature of ray.wait() in recent versions. This PR (https://github.com/pytorch/rl/pull/1908/files) fixes the problem. The PR makes the ray example code run without errors. Thanks a lot for bringing the issue to our attention.

I will also monitor the open issue in the official Ray repository for any updates aimed at resolving compatibility issues with newer Python versions.

from rl.

vmoens avatar vmoens commented on June 26, 2024

@albertbou92 Should we close this or is there anything outstanding?

from rl.

albertbou92 avatar albertbou92 commented on June 26, 2024

I would keep the issue open until ray-project/ray#42914 is solved. atm only works for Python 3.8 or lower.

from rl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.