Autokeras: ImportError: cannot import name 'image_preprocessing' from tensorflow.python.keras.layers.preprocessing import image_preprocessing as image_ops

Created on 21 Aug 2020  路  6Comments  路  Source: keras-team/autokeras

I tried to run autokeras and was hit with the error message upon import autokeras:

from tensorflow.python.keras.layers.preprocessing import image_preprocessing as image_ops
ImportError: cannot import name 'image_preprocessing'

I am currently on:

Keras: 2.2.4
Tensorflow: 2.1.0
OS: Windows 10

Thank you for your help

wontfix

Most helpful comment

  1. Download https://raw.githubusercontent.com/tensorflow/tensorflow/v2.3.0/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py to F:Anaconda3\envs\tflow2\Lib\site-packages\tensorflow_core\python\keras\layers\preprocessing - it just doesnt exist in tf 2.0-2.1
  2. Comment all the [email protected]_keras_serializable(package='Text')_, that will couse an error.

After that tf object detection api works fine, as for me

All 6 comments

We only support TensorFlow 2.3.0 in the latest release of AutoKeras.

  1. Download https://raw.githubusercontent.com/tensorflow/tensorflow/v2.3.0/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py to F:Anaconda3\envs\tflow2\Lib\site-packages\tensorflow_core\python\keras\layers\preprocessing - it just doesnt exist in tf 2.0-2.1
  2. Comment all the [email protected]_keras_serializable(package='Text')_, that will couse an error.

After that tf object detection api works fine, as for me

Any update on this issue?

The solution is to use TF 2.3 with AutoKeras 1.0.10.

@haifeng-jin Solved the issue upgrading tensorflow.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marooncn picture marooncn  路  4Comments

GagaLeung picture GagaLeung  路  4Comments

touching-foots-huskie picture touching-foots-huskie  路  4Comments

kmbmjn picture kmbmjn  路  6Comments

mark-watson picture mark-watson  路  5Comments