Autokeras: test modue now working on mac

Created on 18 Aug 2018  路  7Comments  路  Source: keras-team/autokeras

from keras.datasets import mnist
from autokeras.image_supervised import ImageClassifier

(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train = x_train.reshape(x_train.shape + (1,))
x_test = x_test.reshape(x_test.shape + (1,))

clf = ImageClassifier(verbose=True)
clf.fit(x_train, y_train, time_limit=12 * 60 * 60)
clf.final_fit(x_train, y_train, x_test, y_test, retrain=True)
y = clf.evaluate(x_test, y_test)
print(y)

Bug Description

Reproducing Steps

Steps to reproduce the behavior:

  • Step 1: ...
  • Step 2: ...

Expected Behavior

Setup Details

Include the details about the versions of:

  • OS type and version: mac high sierra 10.13.6(17G65)
  • Python: 3.6(anaconda)
  • autokeras:
  • scikit-learn: 0.19.1
  • numpy: 1.14.5
  • keras:2.2.2
  • scipy:1.1.0
  • tensorflow: 1.8.0
  • pytorch: not installed

Additional context

bug report

Most helpful comment

I had this problem and found out that my file was named autokeras.py, so when I imported the lib, I was actually importing my own file. Changing the file name solved the problem.

All 7 comments

Hey,
I get pretty much the same issue with the first example on MacOSX 10.12
I installed autokeras via a pip3 install autokerasand my python version is a fresh 3.6 from python.org

When I try to run the very first example I get this error:

Traceback (most recent call last):
  File "autokeras.py", line 1, in <module>
    import autokeras as ak
  File "/Users/julien/travail/python/autokeras.py", line 3, in <module>
    clf = ak.ImageClassifier()
AttributeError: module 'autokeras' has no attribute 'ImageClassifier'

@jrenouard
Thank you for your report but we really cannot reproduce the error.
Would you use "python3 -m pip install autokeras" to install, and use "python3" to run the mnist.py?
So that it can make sure the package is installed for the same interpreter you use to run the script.
Thanks.

I followed your steps but still getting the same eroor

I'm getting the same error AttributeError: module 'autokeras' has no attribute 'ImageClassifier' on Ubuntu 18.04.

On Windows 10 it works just fine.

I tried pip3 install autokeras and python3 -m pip install autokeras.

But in Mac it is still showing error

hi @albert-92 @abhisingh007224 , I really cannot reproduce this error. Maybe it is related to the conda environment?

Would you please run the following script with the same python interpreter and paste the output here?
Thank you for your help!

import sys
print(sys.version)
import pkg_resources
pkg_resources.get_distribution("autokeras").version
import autokeras
print(autokeras.__dict__)

I had this problem and found out that my file was named autokeras.py, so when I imported the lib, I was actually importing my own file. Changing the file name solved the problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

max1563 picture max1563  路  4Comments

xuzhang5788 picture xuzhang5788  路  4Comments

zhangjinyangnwpu picture zhangjinyangnwpu  路  4Comments

vincent-hui picture vincent-hui  路  5Comments

kmbmjn picture kmbmjn  路  6Comments