Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

66 lines
2.2KB

  1. # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
  2. # Start FROM NVIDIA PyTorch image https://ngc.nvidia.com/catalog/containers/nvidia:pytorch
  3. FROM nvcr.io/nvidia/pytorch:22.04-py3
  4. RUN rm -rf /opt/pytorch # remove 1.2GB dir
  5. # Downloads to user config dir
  6. ADD https://ultralytics.com/assets/Arial.ttf https://ultralytics.com/assets/Arial.Unicode.ttf /root/.config/Ultralytics/
  7. # Install linux packages
  8. RUN apt update && apt install -y zip htop screen libgl1-mesa-glx
  9. # Install pip packages
  10. COPY requirements.txt .
  11. RUN python -m pip install --upgrade pip
  12. RUN pip uninstall -y torch torchvision torchtext Pillow
  13. RUN pip install --no-cache -r requirements.txt albumentations wandb gsutil notebook Pillow>=9.1.0 \
  14. torch torchvision --extra-index-url https://download.pytorch.org/whl/cu113
  15. # Create working directory
  16. RUN mkdir -p /usr/src/app
  17. WORKDIR /usr/src/app
  18. # Copy contents
  19. COPY . /usr/src/app
  20. RUN git clone https://github.com/ultralytics/yolov5 /usr/src/yolov5
  21. # Set environment variables
  22. ENV OMP_NUM_THREADS=8
  23. # Usage Examples -------------------------------------------------------------------------------------------------------
  24. # Build and Push
  25. # t=ultralytics/yolov5:latest && sudo docker build -f utils/docker/Dockerfile -t $t . && sudo docker push $t
  26. # Pull and Run
  27. # t=ultralytics/yolov5:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all $t
  28. # Pull and Run with local directory access
  29. # t=ultralytics/yolov5:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all -v "$(pwd)"/datasets:/usr/src/datasets $t
  30. # Kill all
  31. # sudo docker kill $(sudo docker ps -q)
  32. # Kill all image-based
  33. # sudo docker kill $(sudo docker ps -qa --filter ancestor=ultralytics/yolov5:latest)
  34. # Bash into running container
  35. # sudo docker exec -it 5a9b5863d93d bash
  36. # Bash into stopped container
  37. # id=$(sudo docker ps -qa) && sudo docker start $id && sudo docker exec -it $id bash
  38. # Clean up
  39. # docker system prune -a --volumes
  40. # Update Ubuntu drivers
  41. # https://www.maketecheasier.com/install-nvidia-drivers-ubuntu/
  42. # DDP test
  43. # python -m torch.distributed.run --nproc_per_node 2 --master_port 1 train.py --epochs 3
  44. # GCP VM from Image
  45. # docker.io/ultralytics/yolov5:latest