keras-team/autokeras

Exception thrown: cannot import name 'keras' from 'tensorflow' (unknown location)

rgoudie opened this issue · 3 comments

Bug Description

After installing AutoKeras and depencies according to instructions, trying to import autokeras throws the exception:
cannot import name 'keras' from 'tensorflow' (unknown location)

Bug Reproduction

from autokeras import StructuredDataClassifier

Expected Behavior

Import succeeds without error.

Setup Details

Include the details about the versions of:

  • Windows 10
  • Python: 3.8.0
  • autokeras: 1.0.20
  • keras-tuner: 1.2.0.dev0
  • keras: 2.11.0
  • scikit-learn: 1.2.0
  • numpy: 1.22.4
  • pandas: 1.5.2
  • tensorflow: 2.11.0

Additional context

The exception is thrown in many instances.

Example: This tutorial website:

import pandas as pd
import tensorflow as tf
import autokeras as ak  <--- same exception thrown

image

It might be a TensorFlow installation problem.
Would you please try import keras from tensorflow in your Python commandline?
It it gives the same error, then it is the TF install problem.

So sorry for the late reply. I never received a notification and completely forgot about the issue.

I will close the issue at this time.