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.3 not running in google Colab

See original GitHub issue

Bug Description

When trying to reproduce MNIST example using the latest master-branch version (which solves issue #1095), the fit method get’s stuck and never finishes. Below the content of notebook I used.

Bug Reproduction

Google colab notebook content:

%tensorflow_version 2.x
import tensorflow as tf
print(tf.__version__) # prints 2.2.0-rc4
!pip install  -v "/content/drive/My Drive/autokeras-master.tar.gz"
.
.
.
.
#Successfully installed autokeras-1.0.3 colorama-0.4.3 keras-tuner-1.0.1 terminaltables-3.1.0
#Cleaning up...
#Removed build tracker '/tmp/pip-req-tracker-c06gu3n1'
tf.debugging.set_log_device_placement(True)
import autokeras as ak
from tensorflow.keras.datasets import mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
print(x_train.shape)  # (60000, 28, 28)
print(y_train.shape)  # (60000,)
print(y_train[:3])  # array([7, 2, 1], dtype=uint8)
clf = ak.ImageClassifier(max_trials=3)
clf.fit(x_train, y_train, epochs=10, verbose=2)

Output:
Executing op TensorSliceDataset in device /job:localhost/replica:0/task:0/device:CPU:0
Executing op TensorSliceDataset in device /job:localhost/replica:0/task:0/device:CPU:0
Executing op ZipDataset in device /job:localhost/replica:0/task:0/device:CPU:0
Executing op OptimizeDataset in device /job:localhost/replica:0/task:0/device:CPU:0
Executing op ModelDataset in device /job:localhost/replica:0/task:0/device:CPU:0
Executing op ReduceDataset in device /job:localhost/replica:0/task:0/device:CPU:0
Executing op TakeDataset in device /job:localhost/replica:0/task:0/device:CPU:0
Executing op SkipDataset in device /job:localhost/replica:0/task:0/device:CPU:0
Executing op BatchDatasetV2 in device /job:localhost/replica:0/task:0/device:CPU:0
Executing op BatchDatasetV2 in device /job:localhost/replica:0/task:0/device:CPU:0
Executing op Fill in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op VarHandleOp in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op VarIsInitializedOp in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op LogicalNot in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op Assert in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op AssignVariableOp in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op Fill in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op VarHandleOp in device /job:localhost/replica:0/task:0/device:CPU:0
Executing op VarIsInitializedOp in device /job:localhost/replica:0/task:0/device:CPU:0
Executing op AssignVariableOp in device /job:localhost/replica:0/task:0/device:CPU:0
Executing op RandomUniform in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op Sub in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op Mul in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op Add in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op VarHandleOp in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op VarHandleOp in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op VarHandleOp in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op VarHandleOp in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op VarHandleOp in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op VarHandleOp in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op VarHandleOp in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op DestroyResourceOp in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op DestroyResourceOp in device /job:localhost/replica:0/task:0/device:CPU:0

then the cell just hangs forever

Setup Details

Include the details about the versions of:

  • OS type and version: Google colab
  • Python: 3.6.9
  • autokeras: master
  • keras-tuner: keras-tuner-1.0.1
  • scikit-learn: 0.22.2.post1
  • numpy: 1.18.3
  • pandas: 1.0.3
  • tensorflow: 2.2.0-rc4

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ruti1012commented, May 10, 2020

Using the latest version of KerasTuner fixed the problem, thanks!

2reactions
qingquansongcommented, May 8, 2020

When using a prior version of both tensorflow (2.1.0) an autokeras (1.0.2) this error doesn’t happen

It might because of the modification of kerastuner. Please try to install a fairly latest version of kerastuner (note: the __version__ attribute of this version may not be correct):

KerasTuner: pip install git+git://github.com/keras-team/keras-tuner.git@d2d69cba21a0b482a85ce2a38893e2322e139c01

TensorFlow: 2.2.0 (or the default 2.2.0rc4 on current Google colab) AutoKeras: 1.0.3 master branch

Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Running autokeras Image Classifier Tutorial on Google ...
The problem is not with the code, I tried it myself on my local machine and it works perfectly. The real problem is...
Read more >
bug_baseline_autokeras.ipynb - Colaboratory - Google Colab
Collecting autokeras Downloading ... Requirement already satisfied: packaging in /usr/local/lib/python3.6/dist-packages (from keras-tuner==1.0.3) (20.4) ...
Read more >
autokeras를 이용한 모델 - DACON
!pip install autokeras !pip install ... /keras_tuner-1.0.3-py3-none-any.whl (96kB) ... from google.colab import files from google.colab import drive ...
Read more >
Solution for submission 171996 | Posts - AIcrowd
Getting Started with Programming Language Classification ... 2.0.0 which is incompatible. google-colab 1.0.0 requires requests~=2.23.0, ...
Read more >
Auto-Keras - Bountysource
I have a problem in stuck model.fit execution with generators. Versions TensorFlow: 2.3.0 AutoKeras: 1.0.12 KerasTuner: 1.0.3. Hardware Google Colab:
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