keras-tuner icon indicating copy to clipboard operation
keras-tuner copied to clipboard

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

Open nidragedd opened this issue 4 years ago • 3 comments

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

nidragedd avatar Nov 23 '20 10:11 nidragedd

Same issue here. Solution: rollback to 1.0.1 version

informatica92 avatar Jan 15 '21 12:01 informatica92

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

burhr2 avatar Feb 11 '22 08:02 burhr2

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

Leon-Brant avatar May 15 '22 07:05 Leon-Brant