-
Notifications
You must be signed in to change notification settings - Fork 74.1k
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
tf.keras works, tf.python.keras doesn't #33075
Comments
The "one difference" was the key; pip failed - downloaded manually. Looking forward to Anaconda support. |
Nope, wasn't it - somehow made it temporarily work, then something else broke, then couldn't get it to work again with several fresh re-installs. Pip also fails to fetch Github's TensorFlow master branch. Likely a bug. Related SO |
This is a side note to your issue, but with tensorflow 2.0 you are not using the separate keras package (instead, you are using the keras implementation embarked within tensorflow). That being said, the imports should work, both with and without specifying |
@OverLordGoldDragon, |
@gadagashwini Your gist is already in my original post - my question concerns why |
TL;DR: The API import is in the root of the package. Any other import is just Python allowing you to access privates with no consideration for good coding practices. Long story short: The only way that imports should be are import tensorflow as tf
tf.keras.... We also provide support for from tensorflow.keras import ... though this is brittle and can break as we keep refactoring. Importing from |
@mihaimaruseac That's fair, except Regardless, your answer may be the real one here; so to confirm, |
Yes, that's exactly the case. Anything under |
Surely something which can silently do different behavior needs warning signs all over it
Imports keras\api\_v2 vs
Imports keras\api\_v1 This is in V1.15.3 |
@LukeBolly Fair suggestion; this can be done by overriding
(Note: |
DOESN'T WORK:
WORKS: remove
.python
from above's imports. Above's error trace below.Keras 2.3.0 and TensorFlow 2.0.0 freshly-installed via Anaconda, older versions uninstalled. Why the difference?
UPDATE: Debugging the two side-by-side, while both use the same files, execution diverges fairly quickly:
Former proceeds to call
training_v2_utils.train_on_batch(...)
and returns thereafter, latterself._standardize_user_data(...)
and others before ultimately failing.One difference I noted between linked file and mine is, latter's short by ~100 lines - though I installed TF 2 via pip after the file's last update 12 days ago according to Github.
The text was updated successfully, but these errors were encountered: