keras-team / keras-tuner

A Hyperparameter Tuning Library for Keras
https://keras.io/keras_tuner/
Apache License 2.0
2.86k stars 396 forks source link

Issue since upgrade 1.0.2 (module 'tensorflow.keras.layers.experimental.preprocessing' has no attribute 'RandomRotation') #448

Open nidragedd opened 4 years ago

nidragedd commented 4 years ago

Hi,

Since Nov the 21st I have issues with some of my jobs in production. I digged and found that this is due to keras-tuner-1.0.2 upgrade (before I was using 1.0.1). Maybe a brad practice but in my requirements.txt, versions were not frozen so it has upgraded by itself this WE.

Anyway, what was previously working like a charm has now this error:

python main_predict.py --environment e--job_type j
Traceback (most recent call last):
  File "main_predict.py", line 11, in <module>
    from src.modeling.rnn.model.rnn import RNN
  File "/home/ec2-user/workspace/user/predict_rnn_van/src/modeling/rnn/model/rnn.py", line 12, in <module>
    import kerastuner as kt
  File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/kerastuner/__init__.py", line 19, in <module>
    from . import applications
  File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/kerastuner/applications/__init__.py", line 19, in <module>
    from .augment import HyperImageAugment
  File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/kerastuner/applications/augment.py", line 34, in <module>
    'rotate': preprocessing.RandomRotation,
AttributeError: module 'tensorflow.keras.layers.experimental.preprocessing' has no attribute 'RandomRotation'

I rollbacked to 1.0.1 and it works but I am letting you know this because the upgrade is not seamless.

tensorflow2_p36 has tensorflow 2.1.2 and python 3.6 on UNIX machines.

EDIT: I checked the tensorflow source code and saw that, yes, the tensorflow.keras.layers.experimental.preprocessing.RandomRotation has been added since r2.2. Maybe I missed this non compatibility information but this is the conclusion I arrived to

informatica92 commented 3 years ago

Same issue here. Solution: rollback to 1.0.1 version

burhr2 commented 2 years ago

rollback to keras-tuner 1.0.1 version did not help. Instead, I updated TensorFlow to 2.2 from 2.1 that I was using previously

Leon-Brant commented 2 years ago

My TensorFlow-GPU version is the latest 2.6, but I still work with