From 90224a7a993a91eeec53ee05a0467736701faf54 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Sun, 13 Apr 2025 12:11:40 +0100 Subject: [PATCH] Install latest tensorflow using pip (#2263) * Install latest tensorflow using pip * Allow tensorflow test to warn * Fix another way --- images/tensorflow-notebook/cuda/Dockerfile | 2 +- .../by_image/tensorflow-notebook/units/unit_tensorflow.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/images/tensorflow-notebook/cuda/Dockerfile b/images/tensorflow-notebook/cuda/Dockerfile index a872e25c..b377251c 100644 --- a/images/tensorflow-notebook/cuda/Dockerfile +++ b/images/tensorflow-notebook/cuda/Dockerfile @@ -19,7 +19,7 @@ RUN mamba install --yes \ # Install TensorFlow, CUDA and cuDNN with pip RUN pip install --no-cache-dir \ - "tensorflow[and-cuda]<=2.17.1" && \ + 'tensorflow[and-cuda]' && \ fix-permissions "${CONDA_DIR}" && \ fix-permissions "/home/${NB_USER}" diff --git a/tests/by_image/tensorflow-notebook/units/unit_tensorflow.py b/tests/by_image/tensorflow-notebook/units/unit_tensorflow.py index 96446a5d..3fa6687d 100644 --- a/tests/by_image/tensorflow-notebook/units/unit_tensorflow.py +++ b/tests/by_image/tensorflow-notebook/units/unit_tensorflow.py @@ -1,5 +1,12 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. +import os +import sys + +if "NVIDIA_VISIBLE_DEVICES" in os.environ: + print("Not running this test in GPU mode") + sys.exit(0) + import tensorflow as tf print(tf.constant("Hello, TensorFlow"))