Autokeras: Tensorflow version problem

Created on 14 Aug 2018  路  9Comments  路  Source: keras-team/autokeras

Even after installing python3.6, tensorflow-gpu, keras, and autokeras, when I do
"import autokeras" or "from autokeras.classifier import ImageClassifier", it gives me

ModuleNotFoundError: No module named 'autokeras.classifier'; 'autokeras' is not a package

  • OS type and version: Linux Ubuntu 16.04
  • Python: 3.6
  • autokeras: 0.2.1
  • scikit-learn: 0.19.1
  • numpy: 1.15.0
  • keras: 2.2.2
  • scipy: 1.1.0
  • tensorflow: 1.10.0
  • pytorch: 0.4.0

How can I fix this?

bug report

Most helpful comment

Check you have no "autokeras.py" file in your current folder.

All 9 comments

I really don't have this error. The only reason I can guess is your pip and python not using the same library. Please use python -m pip install autokeras. I don't know which command you use to run python, but just use it in this way to run pip. @Sungtae-Lee Thanks.

Sent with GitHawk

I installed autokeras by "pip3 install autokeras"
ran "python3"
then, used import autokeras

=====================================================
I have succeeded in changing the error message and it persists even after using
"python -m pip install autokeras"
I did it by installing pytorch manually other than the one installed while installing autokeras.
It seems like tensorflow also need to be installed manually.

Now the error is

import autokeras
Using TensorFlow backend.
Traceback (most recent call last):
File "", line 1, in
File "/mnt/hkim/deepcas9/autokeras.py", line 1, in
from keras.datasets import mnist
File "/home/hkim/.local/lib/python3.6/site-packages/keras/__init__.py", line 3, in
from . import utils
File "/home/hkim/.local/lib/python3.6/site-packages/keras/utils/__init__.py", line 6, in
from . import conv_utils
File "/home/hkim/.local/lib/python3.6/site-packages/keras/utils/conv_utils.py", line 9, in
from .. import backend as K
File "/home/hkim/.local/lib/python3.6/site-packages/keras/backend/__init__.py", line 89, in
from .tensorflow_backend import *
File "/home/hkim/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 5, in
import tensorflow as tf
File "/home/hkim/.local/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/home/hkim/.local/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 63, in
from tensorflow.python.framework.framework_lib import * # pylint: disable=redefined-builtin
File "/home/hkim/.local/lib/python3.6/site-packages/tensorflow/python/framework/framework_lib.py", line 104, in
from tensorflow.python.framework.importer import import_graph_def
File "/home/hkim/.local/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 32, in
from tensorflow.python.framework import function
File "/home/hkim/.local/lib/python3.6/site-packages/tensorflow/python/framework/function.py", line 36, in
from tensorflow.python.ops import resource_variable_ops
File "/home/hkim/.local/lib/python3.6/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 35, in
from tensorflow.python.ops import variables
File "/home/hkim/.local/lib/python3.6/site-packages/tensorflow/python/ops/variables.py", line 40, in
class Variable(checkpointable.CheckpointableBase):

AttributeError: module 'tensorflow.python.training.checkpointable' has no attribute 'CheckpointableBase'

About pip and python library
$ pip3 --version
pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.6)

import site; site.getsitepackages()
['/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.6/dist-packages']

Thank you for helping @jhfjhfj1

Please try to upgrade your tensorflow to the required version.
@Sungtae-Lee

If I install tensorflow without autokeras, it installs tensorflow 1.10.0 and it works well.
However if i install autokeras with tensorflow, tensorflow version gets fixed to 1.8.0 and it gives errors.
Even if I specify the version of tensorflow while installing after installing autokeras, tensorflow version is fixed to 1.8.0.
Do you know how to upgrade tensorflow version to 1.10.0 after installing autokeras? @jhfjhfj1 Thanks

@Sungtae-Lee
You can first install autokeras, then upgrade the tensorflow.
This is a temporary solution.

I tried with mine. It works well with tensorflow 1.8.0.
I suggest you use virtualenvwrapper to just install autokeras and try.

It seems work after several reinstalling... Thanks! @jhfjhfj1

I had the same issue, running in Colab

Using:

import autokeras as ak 
.....
clf = ak.ImageClassifier(verbose=True, augment=False)

Instead of:

from autokeras.classifier import ImageClassifier

Seems to fix the issue, but then when I execute the code block, the kernel dies.

Check you have no "autokeras.py" file in your current folder.

I had the same issue, running in Colab

Using:

import autokeras as ak 
.....
clf = ak.ImageClassifier(verbose=True, augment=False)

Instead of:

from autokeras.classifier import ImageClassifier

Seems to fix the issue, but then when I execute the code block, the kernel dies.

@SkanderHn Have you found a fix?

Was this page helpful?
0 / 5 - 0 ratings