Comments (8)
Cc @albertbou92
from rl.
I am able to reproduce the bug. Let me look into it.
from rl.
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.
from rl.
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.
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.
@albertbou92 Should we close this or is there anything outstanding?
from rl.
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)
- [BUG] Parallel envs override each others' num threads HOT 1
- [BUG] `check_env_specs` shouldn't set `torch.manual_seed` by default. HOT 3
- [BUG] Problems with BatchedEnv on accelerated device with single envs on cpu HOT 29
- [BUG] Truncated key is on different devices with BatchedEnv on different device than single envs. HOT 2
- [Feature Request] partial steps in batches envs HOT 1
- [BUG] SliceSampler proposes indices outside storage content
- [Feature Request] PrioritizedSliceSampler
- [BUG]
- [Feature Request] Multi-dim RBs
- [Feature Request] Streamline preproc of datasets HOT 2
- [BUG] UserWarning: Failed to import torchrl C++ binaries HOT 4
- [Feature Request] Make `KLControllerBase` independent of the model HOT 1
- [BUG] Asked to report bug by a `UserWarning` HOT 1
- [Feature Request] Tutorial for custom env with complex shapes HOT 1
- [Feature Request] Why have mutually exclusive terminated and truncated? HOT 8
- [BUG] `FlattenObservation` transform with `OneHotDiscreteTensorSpec` HOT 7
- [Feature Request] A way to specify the input of environment resets through the DataCollector HOT 11
- [BUG] I had to patch these 2 methods in order to run my script HOT 4
- [Feature Request] Expose `time_dim` parameter on `GAE` and other advantage estimators HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rl.