From bd5016211f20c7abd97554ce5370739a712eb07a Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 17 May 2024 13:26:18 +0200 Subject: [PATCH] Update pip install arg `--no-cache-dir` (#12773) Signed-off-by: Glenn Jocher --- docker/Dockerfile | 8 ++++---- docker/Dockerfile-arm64 | 2 +- docker/Dockerfile-cpu | 4 ++-- docker/Dockerfile-jetson | 4 ++-- docker/Dockerfile-python | 4 ++-- ultralytics/utils/checks.py | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index ebc49ee0..b3b023a5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,7 +4,7 @@ # Start FROM PyTorch image https://hub.docker.com/r/pytorch/pytorch or nvcr.io/nvidia/pytorch:23.03-py3 FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime -RUN pip install --no-cache nvidia-tensorrt --index-url https://pypi.ngc.nvidia.com +RUN pip install --no-cache-dir nvidia-tensorrt --index-url https://pypi.ngc.nvidia.com # Downloads to user config dir ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \ @@ -30,16 +30,16 @@ ADD https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt /u # Install pip packages RUN python3 -m pip install --upgrade pip wheel -RUN pip install --no-cache -e ".[export]" "albumentations>=1.4.6" comet pycocotools +RUN pip install --no-cache-dir -e ".[export]" "albumentations>=1.4.6" comet pycocotools # Run exports to AutoInstall packages # Edge TPU export fails the first time so is run twice here RUN yolo export model=tmp/yolov8n.pt format=edgetpu imgsz=32 || yolo export model=tmp/yolov8n.pt format=edgetpu imgsz=32 RUN yolo export model=tmp/yolov8n.pt format=ncnn imgsz=32 # Requires <= Python 3.10, bug with paddlepaddle==2.5.0 https://github.com/PaddlePaddle/X2Paddle/issues/991 -RUN pip install --no-cache paddlepaddle>=2.6.0 x2paddle +RUN pip install --no-cache-dir paddlepaddle>=2.6.0 x2paddle # Fix error: `np.bool` was a deprecated alias for the builtin `bool` segmentation error in Tests -RUN pip install --no-cache numpy==1.23.5 +RUN pip install --no-cache-dir numpy==1.23.5 # Remove exported models RUN rm -rf tmp diff --git a/docker/Dockerfile-arm64 b/docker/Dockerfile-arm64 index b681c8a5..0a03410d 100644 --- a/docker/Dockerfile-arm64 +++ b/docker/Dockerfile-arm64 @@ -31,7 +31,7 @@ RUN rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED # Install pip packages RUN python3 -m pip install --upgrade pip wheel -RUN pip install --no-cache -e ".[export]" +RUN pip install --no-cache-dir -e ".[export]" # Creates a symbolic link to make 'python' point to 'python3' RUN ln -sf /usr/bin/python3 /usr/bin/python diff --git a/docker/Dockerfile-cpu b/docker/Dockerfile-cpu index 36875527..feb8d535 100644 --- a/docker/Dockerfile-cpu +++ b/docker/Dockerfile-cpu @@ -28,13 +28,13 @@ RUN rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED # Install pip packages RUN python3 -m pip install --upgrade pip wheel -RUN pip install --no-cache -e ".[export]" --extra-index-url https://download.pytorch.org/whl/cpu +RUN pip install --no-cache-dir -e ".[export]" --extra-index-url https://download.pytorch.org/whl/cpu # Run exports to AutoInstall packages RUN yolo export model=tmp/yolov8n.pt format=edgetpu imgsz=32 RUN yolo export model=tmp/yolov8n.pt format=ncnn imgsz=32 # Requires <= Python 3.10, bug with paddlepaddle==2.5.0 https://github.com/PaddlePaddle/X2Paddle/issues/991 -# RUN pip install --no-cache paddlepaddle>=2.6.0 x2paddle +# RUN pip install --no-cache-dir paddlepaddle>=2.6.0 x2paddle # Remove exported models RUN rm -rf tmp diff --git a/docker/Dockerfile-jetson b/docker/Dockerfile-jetson index 8c3743d1..d518b58a 100644 --- a/docker/Dockerfile-jetson +++ b/docker/Dockerfile-jetson @@ -34,8 +34,8 @@ RUN wget https://nvidia.box.com/shared/static/mvdcltm9ewdy2d5nurkiqorofz1s53ww.w # Install pip packages manually for TensorRT compatibility https://github.com/NVIDIA/TensorRT/issues/2567 RUN python3 -m pip install --upgrade pip wheel RUN pip install onnxruntime_gpu-1.15.1-cp38-cp38-linux_aarch64.whl -RUN pip install --no-cache tqdm matplotlib pyyaml psutil pandas onnx -RUN pip install --no-cache -e ".[export]" +RUN pip install --no-cache-dir tqdm matplotlib pyyaml psutil pandas onnx +RUN pip install --no-cache-dir -e ".[export]" # Set environment variables ENV OMP_NUM_THREADS=1 diff --git a/docker/Dockerfile-python b/docker/Dockerfile-python index 3444d007..db297be3 100644 --- a/docker/Dockerfile-python +++ b/docker/Dockerfile-python @@ -28,13 +28,13 @@ ADD https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt /u # Install pip packages RUN python3 -m pip install --upgrade pip wheel -RUN pip install --no-cache -e ".[export]" --extra-index-url https://download.pytorch.org/whl/cpu +RUN pip install --no-cache-dir -e ".[export]" --extra-index-url https://download.pytorch.org/whl/cpu # Run exports to AutoInstall packages RUN yolo export model=tmp/yolov8n.pt format=edgetpu imgsz=32 RUN yolo export model=tmp/yolov8n.pt format=ncnn imgsz=32 # Requires <= Python 3.10, bug with paddlepaddle==2.5.0 https://github.com/PaddlePaddle/X2Paddle/issues/991 -RUN pip install --no-cache paddlepaddle>=2.6.0 x2paddle +RUN pip install --no-cache-dir paddlepaddle>=2.6.0 x2paddle # Remove exported models RUN rm -rf tmp diff --git a/ultralytics/utils/checks.py b/ultralytics/utils/checks.py index e5f5c80a..60a25bee 100644 --- a/ultralytics/utils/checks.py +++ b/ultralytics/utils/checks.py @@ -391,7 +391,7 @@ def check_requirements(requirements=ROOT.parent / "requirements.txt", exclude=() t = time.time() assert ONLINE, "AutoUpdate skipped (offline)" with Retry(times=2, delay=1): # run up to 2 times with 1-second retry delay - LOGGER.info(subprocess.check_output(f"pip install --no-cache {s} {cmds}", shell=True).decode()) + LOGGER.info(subprocess.check_output(f"pip install --no-cache-dir {s} {cmds}", shell=True).decode()) dt = time.time() - t LOGGER.info( f"{prefix} AutoUpdate success ✅ {dt:.1f}s, installed {n} package{'s' * (n > 1)}: {pkgs}\n"