Skip to content
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

ImportError: cannot import name 'Classifier' #78

Closed
soubh1k opened this issue Aug 13, 2018 · 2 comments
Closed

ImportError: cannot import name 'Classifier' #78

soubh1k opened this issue Aug 13, 2018 · 2 comments
Assignees

Comments

@soubh1k
Copy link

soubh1k commented Aug 13, 2018

Bug Description

from autokeras.image_classifier import ImageClassifier

This gives the following error:

ImportError Traceback (most recent call last)
in ()
1 from keras.datasets import mnist
----> 2 from autokeras.image_classifier import ImageClassifier

/usr/local/lib/python3.6/dist-packages/autokeras/image_classifier.py in ()
18 from autokeras.search import BayesianSearcher, train
19 from autokeras.utils import ensure_dir, has_file, pickle_from_file, pickle_to_file
---> 20 from autokeras.classifier import Classifier
21
22

ImportError: cannot import name 'Classifier'

Reproducing Steps

Steps to reproduce the behavior:
Use this https://colab.research.google.com/drive/1it4U3H8t6fMhLBt_NFmB6vRRN2bVpxFv

Expected Behavior

Separating classifier.py and image_classifier.py has created this problem.

Setup Details

Include the details about the versions of:

  • OS type and version: Linux-4.14.33+-x86_64-with-Ubuntu-17.10-artful
  • Python: 3.6.3
  • scikit-learn: 0.19.1
  • numpy: 1.14.5
  • keras: 2.2.2
  • scipy: 0.19.1
  • tensorflow: 1.10.0
  • pytorch: 0.4.0
@haifeng-jin haifeng-jin self-assigned this Aug 13, 2018
@haifeng-jin
Copy link
Collaborator

Thank you for the bug report.
I just fixed it by changing the examples.
You can reopen the issue if it still fails.

Thanks.

@ZER-0-NE
Copy link

@jhfjhfj1
Running on Google Colab:

/usr/local/lib/python3.6/dist-packages/autokeras/__init__.py in <module>()
----> 1 from autokeras.image.image_supervised import ImageClassifier, ImageRegressor, PortableImageSupervised
      2 from autokeras.text.text_supervised import TextClassifier
      3 from autokeras.net_module import CnnModule, MlpModule

ImportError: cannot import name 'ImageClassifier'

Code:

# !pip install autokeras
from autokeras.image.image_supervised import ImageClassifier
from autokeras.image.image_supervised import load_image_dataset


x_train, y_train = load_image_dataset(csv_file_path="train/label.csv",
                                      images_path="train")
print(x_train.shape)
print(y_train.shape)

x_test, y_test = load_image_dataset(csv_file_path="val/label.csv",
                                    images_path="val")
print(x_test.shape)
print(y_test.shape)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants