From 2fe0946376ee3ded84023dabf00a50bfb614f011 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 8 Jun 2024 23:34:51 +0200 Subject: [PATCH] Fix Paddle 2.6.0 Dockerfile install bug (#13447) Signed-off-by: Glenn Jocher --- docker/Dockerfile | 4 ++-- docker/Dockerfile-arm64 | 2 +- docker/Dockerfile-cpu | 7 +++---- docker/Dockerfile-jetson | 2 +- docker/Dockerfile-python | 6 +++--- ultralytics/engine/trainer.py | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 605ca0a4c5..e59825eabc 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -31,7 +31,7 @@ WORKDIR $APP_HOME # Copy contents and assign permissions COPY . $APP_HOME -RUN chown -R root:root $APP_HOME +RUN git remote set-url origin https://github.com/ultralytics/ultralytics.git ADD https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt $APP_HOME # Install pip packages @@ -43,7 +43,7 @@ RUN pip install --no-cache-dir -e ".[export]" "albumentations>=1.4.6" comet pyco 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-dir 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-dir numpy==1.23.5 # Remove exported models diff --git a/docker/Dockerfile-arm64 b/docker/Dockerfile-arm64 index da68914441..5b89ac8c94 100644 --- a/docker/Dockerfile-arm64 +++ b/docker/Dockerfile-arm64 @@ -25,7 +25,7 @@ WORKDIR $APP_HOME # Copy contents and assign permissions COPY . $APP_HOME -RUN chown -R root:root $APP_HOME +RUN git remote set-url origin https://github.com/ultralytics/ultralytics.git ADD https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt $APP_HOME # Remove python3.11/EXTERNALLY-MANAGED to avoid 'externally-managed-environment' issue, Debian 12 Bookworm error diff --git a/docker/Dockerfile-cpu b/docker/Dockerfile-cpu index 212027478d..fe266bc4bc 100644 --- a/docker/Dockerfile-cpu +++ b/docker/Dockerfile-cpu @@ -23,8 +23,7 @@ WORKDIR $APP_HOME # Copy contents (previously used git clone to avoid permission errors) COPY . $APP_HOME -RUN chown -R root:root $APP_HOME -# RUN git clone https://github.com/ultralytics/ultralytics -b main $APP_HOME +RUN git remote set-url origin https://github.com/ultralytics/ultralytics.git ADD https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt $APP_HOME # Remove python3.11/EXTERNALLY-MANAGED or use 'pip install --break-system-packages' avoid 'externally-managed-environment' Ubuntu nightly error @@ -37,8 +36,8 @@ RUN pip install --no-cache-dir -e ".[export]" --extra-index-url https://download # 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-dir paddlepaddle>=2.6.0 x2paddle +# Requires Python<=3.10, bug with paddlepaddle==2.5.0 https://github.com/PaddlePaddle/X2Paddle/issues/991 +# 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 8537e6b106..7a82a4c827 100644 --- a/docker/Dockerfile-jetson +++ b/docker/Dockerfile-jetson @@ -25,7 +25,7 @@ WORKDIR $APP_HOME # Copy contents and assign permissions COPY . $APP_HOME -RUN chown -R root:root $APP_HOME +RUN git remote set-url origin https://github.com/ultralytics/ultralytics.git ADD https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt $APP_HOME # Remove opencv-python from Ultralytics dependencies as it conflicts with opencv-python installed in base image diff --git a/docker/Dockerfile-python b/docker/Dockerfile-python index 1268647f54..277757206e 100644 --- a/docker/Dockerfile-python +++ b/docker/Dockerfile-python @@ -23,7 +23,7 @@ WORKDIR $APP_HOME # Copy contents and assign permissions COPY . $APP_HOME -RUN chown -R root:root $APP_HOME +RUN git remote set-url origin https://github.com/ultralytics/ultralytics.git ADD https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt $APP_HOME # Remove python3.11/EXTERNALLY-MANAGED or use 'pip install --break-system-packages' avoid 'externally-managed-environment' Ubuntu nightly error @@ -36,8 +36,8 @@ RUN pip install --no-cache-dir -e ".[export]" --extra-index-url https://download # 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-dir paddlepaddle>=2.6.0 x2paddle +# Requires Python<=3.10, bug with paddlepaddle==2.5.0 https://github.com/PaddlePaddle/X2Paddle/issues/991 +RUN pip install --no-cache-dir "paddlepaddle>=2.6.0" x2paddle # Remove exported models RUN rm -rf tmp diff --git a/ultralytics/engine/trainer.py b/ultralytics/engine/trainer.py index 83ee28175e..1584f957d2 100644 --- a/ultralytics/engine/trainer.py +++ b/ultralytics/engine/trainer.py @@ -178,9 +178,9 @@ class BaseTrainer: if self.args.rect: LOGGER.warning("WARNING ⚠️ 'rect=True' is incompatible with Multi-GPU training, setting 'rect=False'") self.args.rect = False - if self.args.batch == -1: + if self.args.batch < 1.0: LOGGER.warning( - "WARNING ⚠️ 'batch=-1' for AutoBatch is incompatible with Multi-GPU training, setting " + "WARNING ⚠️ 'batch<1' for AutoBatch is incompatible with Multi-GPU training, setting " "default 'batch=16'" ) self.args.batch = 16