Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step 3. error importing set_session #32

Open
thedavidhanks opened this issue May 13, 2024 · 2 comments
Open

Step 3. error importing set_session #32

thedavidhanks opened this issue May 13, 2024 · 2 comments

Comments

@thedavidhanks
Copy link

thedavidhanks commented May 13, 2024

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:

  • keras 2.13.1
  • tensorflow 2.13.0

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
Copy link
Owner

Leci37 commented May 17, 2024

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants