Closed imperator-git closed 1 month ago
I second..
I am also having lots of difficulties in order to make it working with latest ray version
Please address this ASAP, I had to downgrade to 2.2.x to make Ray work.
Have you resolved it? My question is exactly the same as yours.
为了使其与最新的射线版本一起工作,我也遇到了很多困难
Have you resolved it? My question is the same as yours. It is also to use the latest version of Ray.
As workaround I used the fork https://github.com/MaxLoedige/tensortrade which supports gymnasium style environments.
Thanks for the reference to MaxLoedige fork!
Request: Could the tensortrade team please help to support the new gymnasium environments?
Details: Tensortrade is leveraging gym environment, but gym project is no longer maintained and got moved to gymnasium in 2021. Learn more about the most important changes here: https://github.com/openai/gym and here: https://github.com/Farama-Foundation/Gymnasium
My Motivation: Specifically I am having trouble using tensortrade 1.0.3 together with ray 2.3.0 - because from ray 2.3.0 on, RLlib only supports the new gymnasium style Env APIs, and now ray gives error that gym style environments (which is used inside tensortrade) is no longer supported ("ValueError: Your environment () does not abide to the new gymnasium-style API!").
The ray error gives already some hints how to approach such change:
1 Run
pip install gymnasium
on your command line. 2 Change all your import statements in your code fromimport gym
->import gymnasium as gym
ORfrom gym.space import Discrete
->from gymnasium.spaces import Discrete
For your custom (single agent) gym.Env classes: 3.1 Either wrap your old Env class via the providedfrom gymnasium.wrappers import EnvCompatibility
wrapper class. 3.2 Alternatively to 3.1:reset()
method to have the call signature 'def reset(self, *, seed=None, options=None)'reset()
method.truncated
flag from yourstep()
method (betweendone
andinfo
). This flag should indicate, whether the episode was terminated prematurely due to some time constraint or other kind of horizon settingThanks a lot for your consideration and I highly appreciate your work on this super tensortrade project.