tensortrade-org / tensortrade

An open source reinforcement learning framework for training, evaluating, and deploying robust trading agents.
https://discord.gg/ZZ7BGWh
Apache License 2.0
4.45k stars 1.01k forks source link

Feature Request: tensortrade should support gymnasium style environments and APIs, rather than old gym environment #460

Closed imperator-git closed 1 month ago

imperator-git commented 1 year ago

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 from import gym -> import gymnasium as gym OR from 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 provided from gymnasium.wrappers import EnvCompatibility wrapper class. 3.2 Alternatively to 3.1:

Thanks a lot for your consideration and I highly appreciate your work on this super tensortrade project.

grizzlybearg commented 1 year ago

I second..

nexsys commented 1 year ago

I am also having lots of difficulties in order to make it working with latest ray version

pavelpichrt commented 11 months ago

Please address this ASAP, I had to downgrade to 2.2.x to make Ray work.

lyzyn commented 8 months ago

Have you resolved it? My question is exactly the same as yours.

lyzyn commented 8 months ago

为了使其与最新的射线版本一起工作,我也遇到了很多困难

Have you resolved it? My question is the same as yours. It is also to use the latest version of Ray.

imperator-git commented 8 months ago

As workaround I used the fork https://github.com/MaxLoedige/tensortrade which supports gymnasium style environments.

carlogrisetti commented 1 month ago

Thanks for the reference to MaxLoedige fork!