Leci37 / TensorFlow-stocks-prediction-Machine-learning-RealTime

Predict operation stocks points (buy-sell) with past technical patterns, and powerful machine-learning libraries such as: Sklearn.RandomForest , Sklearn.GradientBoosting, XGBoost, Google TensorFlow and Google TensorFlow LSTM..Real time Twitter:
241 stars 75 forks source link

Step 3. error importing set_session #32

Open thedavidhanks opened 3 months ago

thedavidhanks commented 3 months ago

https://github.com/Leci37/TensorFlow-stocks-prediction-Machine-learning-RealTime/blob/386a580efbb2828dd366b20df2a031d45e5f9252/3_Model_creation_models_for_a_stock.py#L6

When running 3_Model_creation_models_for_a_stock.py I'm receiving the following error:

Traceback (most recent call last):
  File "3_Model_creation_models_for_a_stock.py", line 6, in <module>
    from keras.backend import set_session
ImportError: cannot import name 'set_session' from 'keras.backend'

Is set_session needed? Line 14 appears to be commented out.

I'm using the following package versions:

Note that I'm able to change

from tensorflow import keras
from keras.backend import set_session

TO from tensorflow.python.keras.backend import set_session set_sesion is imported successfully.

To me, this implies that keras should not be included in the requirement doc since it is part of tensorflow.

Leci37 commented 3 months ago

This sentence of yours is correct “this implies that keras should not be included in the requirements document since it is part of tensorflow.”

I don't know where changing that code could make the code fail, you need to know the points before affirming that you can remove the keras requirement.

Currently, the team lacks time for that task, if you want to make a small evaluation we will include it.

Thank you very much for your time david.

thedavidhanks commented 3 months ago

What do you mean by,

you need to know the points before affirming that you can remove the keras requirement the points of what?

I was suggesting that either line 6 be removed, because set_session is not called or If set_session uncommented on line 16, then set_session should be imported from the appropriate location of the tensorflow package.