1+ set -e
2+ set -x
3+
4+ cd " ${KOKORO_ROOT} /"
5+
6+ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
7+
8+ PYTHON_BINARY=" /usr/bin/python3.9"
9+
10+ " ${PYTHON_BINARY} " -m venv venv
11+ source venv/bin/activate
12+ # Check the python version
13+ python --version
14+ python3 --version
15+
16+ export LD_LIBRARY_PATH=" $LD_LIBRARY_PATH :/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:"
17+ # Check cuda
18+ nvidia-smi
19+ nvcc --version
20+
21+ cd " src/github/keras-cv"
22+ pip install -U pip setuptools
23+
24+ if [ " ${KERAS2:- 0} " == " 1" ]
25+ then
26+ echo " Keras2 detected."
27+ pip install -r requirements-common.txt --progress-bar off
28+ pip install tensorflow~=2.14
29+ pip install --extra-index-url https://download.pytorch.org/whl/cpu torch==2.1.0+cpu
30+ pip install torchvision~=0.16.0
31+ pip install " jax[cpu]"
32+
33+ elif [ " $KERAS_BACKEND " == " tensorflow" ]
34+ then
35+ echo " TensorFlow backend detected."
36+ pip install -r requirements-tensorflow-cuda.txt --progress-bar off
37+
38+ elif [ " $KERAS_BACKEND " == " jax" ]
39+ then
40+ echo " JAX backend detected."
41+ pip install -r requirements-jax-cuda.txt --progress-bar off
42+
43+ elif [ " $KERAS_BACKEND " == " torch" ]
44+ then
45+ echo " PyTorch backend detected."
46+ pip install -r requirements-torch-cuda.txt --progress-bar off
47+ fi
48+
49+ pip install --no-deps -e " ." --progress-bar off
50+
51+ # Run Extra Large Tests for Continuous builds
52+ if [ " ${RUN_XLARGE:- 0} " == " 1" ]
53+ then
54+ pytest --check_gpu --run_large --run_extra_large --durations 0 \
55+ keras_cv/bounding_box \
56+ keras_cv/callbacks \
57+ keras_cv/losses \
58+ keras_cv/layers/object_detection \
59+ keras_cv/layers/preprocessing \
60+ keras_cv/models/backbones \
61+ keras_cv/models/classification \
62+ keras_cv/models/object_detection/retinanet \
63+ keras_cv/models/object_detection/yolo_v8 \
64+ keras_cv/models/object_detection_3d \
65+ keras_cv/models/segmentation \
66+ keras_cv/models/stable_diffusion \
67+ --cov=keras-cv
68+ else
69+ pytest --check_gpu --run_large --durations 0 \
70+ keras_cv/bounding_box \
71+ keras_cv/callbacks \
72+ keras_cv/losses \
73+ keras_cv/layers/object_detection \
74+ keras_cv/layers/preprocessing \
75+ keras_cv/models/backbones \
76+ keras_cv/models/classification \
77+ keras_cv/models/object_detection/retinanet \
78+ keras_cv/models/object_detection/yolo_v8 \
79+ keras_cv/models/object_detection_3d \
80+ keras_cv/models/segmentation \
81+ keras_cv/models/stable_diffusion \
82+ --cov=keras-cv
83+ fi
0 commit comments