AI4Finance-Foundation / ElegantRL

Massively Parallel Deep Reinforcement Learning. 🔥
https://ai4finance.org
Other
3.54k stars 816 forks source link

Problem with running FinRL_PaperTrading_Demo.ipynb #96

Open augustyno opened 2 years ago

augustyno commented 2 years ago

First when installing FinRL ,i.e., executing

!pip install git+https://github.com/AI4Finance-LLC/FinRL-Library.git

I see the following error message:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. google-colab 1.0.0 requires requests~=2.23.0, but you have requests 2.27.1 which is incompatible. datascience 0.10.6 requires folium==0.2.1, but you have folium 0.8.3 which is incompatible.

Second, when importing modules: i.e., executing:

from finrl.train import train

I'm getting the following error messages:

ModuleNotFoundError Traceback (most recent call last)

in () ----> 1 from finrl.train import train 2 from finrl.test import test 3 from finrl.apps.config import DOW_30_TICKER 4 from finrl.apps.config import TECHNICAL_INDICATORS_LIST 5 from finrl.finrl_meta.env_stock_trading.env_stocktrading_np import StockTradingEnv 1 frames /usr/local/lib/python3.7/dist-packages/finrl/drl_agents/elegantrl/models.py in () 7 from elegantrl.agents.AgentA2C import AgentA2C 8 from elegantrl.train.config import Arguments ----> 9 from elegantrl.train.run_tutorial import train_and_evaluate 10 11 MODELS = {"ddpg": AgentDDPG, "td3": AgentTD3, "sac": AgentSAC, "ppo": AgentPPO, "a2c": AgentA2C} ModuleNotFoundError: No module named 'elegantrl.train.run_tutorial' The above message is recent. Before I did receive this error message.
supersglzc commented 2 years ago

This is because we updated a new version of ElegantRL yesterday, and the file 'run_tutorial' no longer exists. If you would like to import the function 'train_and_evaluate', please try: from elegantrl.train.run import train_and_evaluate.

augustyno commented 2 years ago

Steven, Thanks for info. I noticed that train function and train_and_evaluate use different arguments. The train_and_evaluate uses only args. Can you send me please example of args to execute train_and_evaluate.

Many thanks, Augustyn

On Thu, Jan 6, 2022 at 2:03 PM Steven Li @.***> wrote:

This is because we updated a new version of ElegantRL yesterday, and the file 'run_tutorial' no longer exists. If you would like to import the function 'train_and_evaluate', please try: from elegantrl.train.run import train_and_evaluate.

— Reply to this email directly, view it on GitHub https://github.com/AI4Finance-Foundation/ElegantRL/issues/96#issuecomment-1006896772, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR3JWYHZ4OOYTWRXAQONK63UUXYSVANCNFSM5LMSZM4A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

Quakumei commented 11 months ago

As of now, from elegantrl.train.run import train_and_evaluate results in ImportError

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/quakuei/Desktop/docusketch/trading-bot/trading_bot/train/train_elegantrl.py", line 4, in <module>
    from trading_bot.agents.elegantrl_models import DRLAgent
  File "/home/quakuei/Desktop/docusketch/trading-bot/trading_bot/agents/elegantrl_models.py", line 10, in <module>
    from elegantrl.train.run import train_and_evaluate
ImportError: cannot import name 'train_and_evaluate' from 'elegantrl.train.run' (/home/quakuei/Desktop/docusketch/trading-bot/venv/lib/python3.10/site-packages/elegantrl/train/run.py