diff --git a/Dockerfile.test.cpu b/Dockerfile.test.cpu index ca7352b7e7..ffa8854f5c 100644 --- a/Dockerfile.test.cpu +++ b/Dockerfile.test.cpu @@ -145,21 +145,20 @@ RUN if [[ ${MPI_KIND} != "None" ]]; then \ fi # Install TensorFlow and Keras (releases). -# Pin h5py only for tensorflow<2.5: https://github.com/h5py/h5py/issues/1732 # Pin scipy!=1.4.0: https://github.com/scipy/scipy/issues/11237 RUN if [[ ${TENSORFLOW_PACKAGE} != "tf-nightly" ]]; then \ pip install --no-cache-dir ${TENSORFLOW_PACKAGE}; \ if [[ ${KERAS_PACKAGE} != "None" ]]; then \ - if [[ ${TENSORFLOW_PACKAGE} == tensorflow*==1.* ]] || [[ ${TENSORFLOW_PACKAGE} == tensorflow*==2.[012345].* ]]; then \ - h5py="h5py<3"; \ - fi; \ pip uninstall -y keras-nightly; \ - pip install --no-cache-dir ${KERAS_PACKAGE} ${h5py:-} "scipy!=1.4.0" "pandas<1.1.0"; \ + pip install --no-cache-dir ${KERAS_PACKAGE} "scipy!=1.4.0" "pandas<1.1.0"; \ fi; \ mkdir -p ~/.keras; \ python -c "import tensorflow as tf; tf.keras.datasets.mnist.load_data()"; \ fi +# Pin h5py < 3 for tensorflow: https://github.com/tensorflow/tensorflow/issues/44467 +RUN pip install 'h5py<3.0' --force-reinstall + # Install PyTorch (releases). # Pin Pillow<7.0 for torchvision < 0.5.0: https://github.com/pytorch/vision/issues/1718 # Pin Pillow!=8.3.0 for torchvision: https://github.com/pytorch/vision/issues/4146 diff --git a/Dockerfile.test.gpu b/Dockerfile.test.gpu index afe64e1b01..e42c55c71b 100644 --- a/Dockerfile.test.gpu +++ b/Dockerfile.test.gpu @@ -113,16 +113,12 @@ RUN if [[ ${MPI_KIND} != "None" ]]; then \ fi # Install TensorFlow and Keras (releases). -# Pin h5py only for tensorflow<2.5: https://github.com/h5py/h5py/issues/1732 # Pin scipy!=1.4.0: https://github.com/scipy/scipy/issues/11237 RUN if [[ ${TENSORFLOW_PACKAGE} != "tf-nightly-gpu" ]]; then \ pip install --no-cache-dir ${TENSORFLOW_PACKAGE}; \ if [[ ${KERAS_PACKAGE} != "None" ]]; then \ - if [[ ${TENSORFLOW_PACKAGE} == tensorflow*==1.* ]] || [[ ${TENSORFLOW_PACKAGE} == tensorflow*==2.[012345].* ]]; then \ - h5py="h5py<3"; \ - fi; \ pip uninstall -y keras-nightly; \ - pip install --no-cache-dir ${KERAS_PACKAGE} ${h5py:-} "scipy!=1.4.0" "pandas<1.1.0"; \ + pip install --no-cache-dir ${KERAS_PACKAGE} "scipy!=1.4.0" "pandas<1.1.0"; \ fi; \ mkdir -p ~/.keras; \ ldconfig /usr/local/cuda/targets/x86_64-linux/lib/stubs; \ @@ -130,6 +126,9 @@ RUN if [[ ${TENSORFLOW_PACKAGE} != "tf-nightly-gpu" ]]; then \ ldconfig; \ fi +# Pin h5py < 3 for tensorflow: https://github.com/tensorflow/tensorflow/issues/44467 +RUN pip install 'h5py<3.0' --force-reinstall + # Install PyTorch (releases). # Pin Pillow<7.0 for torchvision < 0.5.0: https://github.com/pytorch/vision/issues/1718 # Pin Pillow!=8.3.0 for torchvision: https://github.com/pytorch/vision/issues/4146 diff --git a/horovod/spark/keras/tensorflow.py b/horovod/spark/keras/tensorflow.py index 2f63724e5f..141d228ccb 100644 --- a/horovod/spark/keras/tensorflow.py +++ b/horovod/spark/keras/tensorflow.py @@ -19,7 +19,7 @@ from horovod.common.util import is_version_greater_equal_than -if is_version_greater_equal_than(tf.__version__, "2.5.0"): +if is_version_greater_equal_than(tf.__version__, "2.6.0"): from keras import backend as K from keras import optimizers else: diff --git a/horovod/tensorflow/keras/__init__.py b/horovod/tensorflow/keras/__init__.py index 6d18bcf746..483a90fa7e 100644 --- a/horovod/tensorflow/keras/__init__.py +++ b/horovod/tensorflow/keras/__init__.py @@ -22,7 +22,7 @@ from horovod.common.util import is_version_greater_equal_than -if is_version_greater_equal_than(tf.__version__, "2.5.0"): +if is_version_greater_equal_than(tf.__version__, "2.6.0"): from keras import backend as K else: from tensorflow.python.keras import backend as K diff --git a/horovod/tensorflow/keras/callbacks.py b/horovod/tensorflow/keras/callbacks.py index 5e6dbeb1c0..2ee3323dfa 100644 --- a/horovod/tensorflow/keras/callbacks.py +++ b/horovod/tensorflow/keras/callbacks.py @@ -19,7 +19,7 @@ from horovod.common.util import is_version_greater_equal_than -if is_version_greater_equal_than(tf.__version__, "2.5.0"): +if is_version_greater_equal_than(tf.__version__, "2.6.0"): from keras import backend as K else: from tensorflow.python.keras import backend as K diff --git a/test/integration/test_spark.py b/test/integration/test_spark.py index bbca54e491..f2098a2ca6 100644 --- a/test/integration/test_spark.py +++ b/test/integration/test_spark.py @@ -1665,7 +1665,6 @@ def test_spark_task_service_execute_command(self): file = os.path.sep.join([d, 'command_executed']) self.do_test_spark_task_service_executes_command(client, file) - @mock.patch('horovod.runner.common.util.safe_shell_exec.GRACEFUL_TERMINATION_TIME_S', 0.5) def test_spark_task_service_abort_command(self): with spark_task_service(index=0) as (service, client, _): with tempdir() as d: diff --git a/test/integration/test_spark_keras.py b/test/integration/test_spark_keras.py index 2e107ea9fe..8be04c1ab8 100644 --- a/test/integration/test_spark_keras.py +++ b/test/integration/test_spark_keras.py @@ -72,9 +72,6 @@ def fit(model, train_data, val_data, steps_per_epoch, validation_steps, callback return fit -#PR3099 [https://github.com/horovod/horovod/pull/3099] doesn't fix -#Tensorflow>=2.6.0 tests -@pytest.mark.skipif(LooseVersion(tf.__version__) >= LooseVersion('2.6.0'), reason='TensorFlow>=2.6.0 tests') class SparkKerasTests(tf.test.TestCase): def __init__(self, *args, **kwargs): super(SparkKerasTests, self).__init__(*args, **kwargs) diff --git a/test/parallel/test_tensorflow2_keras.py b/test/parallel/test_tensorflow2_keras.py index 6836c43185..d15fc3ad8d 100644 --- a/test/parallel/test_tensorflow2_keras.py +++ b/test/parallel/test_tensorflow2_keras.py @@ -29,7 +29,7 @@ from horovod.common.util import is_version_greater_equal_than -if is_version_greater_equal_than(tf.__version__, "2.5.0"): +if is_version_greater_equal_than(tf.__version__, "2.6.0"): from keras.optimizer_v2 import optimizer_v2 else: from tensorflow.python.keras.optimizer_v2 import optimizer_v2 diff --git a/test/parallel/test_tensorflow_keras.py b/test/parallel/test_tensorflow_keras.py index 763892c902..03e2001a08 100644 --- a/test/parallel/test_tensorflow_keras.py +++ b/test/parallel/test_tensorflow_keras.py @@ -28,7 +28,7 @@ from horovod.common.util import is_version_greater_equal_than -if is_version_greater_equal_than(tf.__version__, "2.5.0"): +if is_version_greater_equal_than(tf.__version__, "2.6.0"): from keras import backend as K from keras.optimizer_v2 import optimizer_v2 else: