Skip to content

There is an error with Keras.__version__ in the Tensorflow Notebook #64

@edwinsibarra

Description

@edwinsibarra

As of the console output, Keras has no attribute called "version".

Keras has been integrated into Tensorflow and when imported from tensorflow they have the same version.

At least according to StackOverflow:

https://stackoverflow.com/questions/73934025/attributeerror-module-keras-has-no-attribute-version

The resolutions of this issue would consist of deleting one line of code in https://github.com/MicrosoftDocs/ml-basics/blob/master/05a%20-%20Deep%20Neural%20Networks%20(TensorFlow).ipynb right after importing TF.

import tensorflow
from tensorflow import keras
from tensorflow.keras import models
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras import utils
from tensorflow.keras import optimizers

# Set random seed for reproducability
tensorflow.random.set_seed(0)

print("Libraries imported.")
print('Keras version:',keras.__version__) #This line has to go
print('TensorFlow version:',tensorflow.__version__)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions