question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AutoKeras 1.0 much slower than 0.4 on Google Colab

See original GitHub issue

When I try to run a simple MNIST example on Google Colab with GPU with Autokeras 0.4 it runs very fast (1 epoch of the first model takes < 2 s) but with 1.0 it runs much slower (1 epoch of the first model takes > 80 s). When I disable the GPU 0.4 runs as slow as 1.0 which suggests that 1.0 isn’t using the GPU. How can I make Autokeras 1.0 run as fast as 0.4 with GPU?

To reproduce go to colab.research.google.com, choose a Python 3 runtime with GPU accelerator, and execute the following

0.4 code

%tensorflow_version 1.x

!pip install autokeras

import autokeras
import tensorflow

( ( x, y ), validation_data ) = tensorflow.keras.datasets.mnist.load_data( )
model = autokeras.ImageClassifier( verbose = True )
model.fit( x, y )

1.0 code

%tensorflow_version 2.x

!pip install git+git://github.com/keras-team/keras-tuner@master#egg=keras-tuner
!pip install git+git://github.com/keras-team/autokeras@master#egg=autokeras

import tensorflow
import autokeras

( ( x, y ), validation_data ) = tensorflow.keras.datasets.mnist.load_data( )
model = autokeras.ImageClassifier( )
model.fit( x, y, validation_data = validation_data )

The issue is breakdown to the following issues. After solving them, the speed should be improved.

#906, #907, #908, #909, #910.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pezdoradocommented, Dec 9, 2019

I’ve tried the functional API with an ImageBlock( augment = False ) but it’s as slow as the task API. I hope I applied the functional API correctly since the tutorial is quite sparse

!pip install git+git://github.com/keras-team/autokeras@master#egg=autokeras

import tensorflow
import autokeras

( ( x, y ), validation_data ) = tensorflow.keras.datasets.mnist.load_data( )

inputs = autokeras.ImageInput( )
blocks = autokeras.hypermodel.hyperblock.ImageBlock( augment = False )( inputs )
outputs = autokeras.ClassificationHead( )( blocks )

model = autokeras.GraphAutoModel(
    inputs = inputs,
    outputs = outputs
)

model.fit( x, y, validation_split = 0.1, batch_size = 128 )

Did I apply the functional API correctly and did I correctly turn off augmentation? If so, then the problem does not seem to be caused by augmentation.

0reactions
haifeng-jincommented, Jan 19, 2020

This issue has been breakdown to multiple parts in the AutoKeras Project. After adopting the preprocessing layers the issue should be resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Colab is very slow compared to my PC - Stack Overflow
It's very slow to read file from google drives. ... The solution is to upload zip file to colab and unzip there. Hope...
Read more >
tensorflow-metal | Apple Developer Forums
The code is executable on Google Colab but can't run on Mac mini locally with ... 1.4.1 autokeras : 1.0.2 keras : 2.8.0...
Read more >
ibm-unir_tfm_ach.ipynb - Colaboratory - Google Colab
... (from keras-tuner>=1.0.1->autokeras) (0.4.3) Requirement already satisfied: requests ... The "accuracy" scoring is proportional to the number of correct
Read more >
Time series forecasting | TensorFlow Core
This tutorial is an introduction to time series forecasting using TensorFlow. It builds a few different styles of models including Convolutional and ...
Read more >
Robust hyperparameter optimization for machine learning
Table 1 shows a detailed comparison of these “all-round” packages to Sherpa. Note that we excluded Google Vizier [23] and similar frameworks from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found