AI4Finance-Foundation / FinRL

FinRL: Financial Reinforcement Learning. 🔥
https://ai4finance.org
MIT License
9.61k stars 2.33k forks source link

FinRL_PaperTrading_Demo - cannot import name 'init_agent' from 'elegantrl.run' when importing train from finrl.train #450

Closed florian-guily closed 2 years ago

florian-guily commented 2 years ago

Hi, when running the FinRL_PaperTrading_Demo.ipynb notebook, i'm facing an import issue on finrl.train. This is the only issue that causes this error and when i look in the elegantrl.run file, there is no 'init_agent' as mentioned in the error despite its import in finrl.models.

I'm using the latest version of finRL with python 3.8 on a clean new virtual env. Also only the import of train causes this issue as when i comment this line, everything is fine.

Maybe i should use train_and_evaluate method directly as in the other elegantRL examples.

What do you think ?

florian-guily commented 2 years ago

Any news about this ?

florian-guily commented 2 years ago

Update:

Working on google colab but still not working locally.

Tried also with a virtual env with python 3.7.12 inside (same version as Google Colab) but still not working. I don't know what to do.

rayrui312 commented 2 years ago

I tried it locally, and it worked well. You may try to update to the newest version of ElegantRL.

florian-guily commented 2 years ago

Working whe reinstalling everything with finrl from pypi. Weird behaviour. I was installing from the github link

udipuding commented 1 year ago

Hi, any update on this? still getting this error when running the following - python main.py --mode=train

Thanks!!

dewrussdx commented 1 year ago

bump, still appears to be an issue. The ElegantRL package on pypi does not have the function init_agent since 0.3.3 from Jan 8, 2022). Neither 0.3.5 (0.3.4 doesn't exist) or the latest 0.3.6 have init_agent. Downgrading works however causes other issues in the FinRL library. Using the suggestion here of installing FinRL from pypi didn't work (since they also reference ElegantRL 0.3.6 as requirement). Any updates on this?

Quakumei commented 1 year ago

Bump, still an issue when running FinRL_MultiCrypto_Trading.ipynb

Didn't try downgrading, but nevertheless