No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

55 líneas
1.8KB

  1. # Start FROM Nvidia PyTorch image https://ngc.nvidia.com/catalog/containers/nvidia:pytorch
  2. FROM nvcr.io/nvidia/pytorch:20.12-py3
  3. # Install linux packages
  4. RUN apt update && apt install -y screen libgl1-mesa-glx
  5. # Install python dependencies
  6. RUN python -m pip install --upgrade pip
  7. COPY requirements.txt .
  8. RUN pip install -r requirements.txt gsutil
  9. # Create working directory
  10. RUN mkdir -p /usr/src/app
  11. WORKDIR /usr/src/app
  12. # Copy contents
  13. COPY . /usr/src/app
  14. # Copy weights
  15. #RUN python3 -c "from models import *; \
  16. #attempt_download('weights/yolov5s.pt'); \
  17. #attempt_download('weights/yolov5m.pt'); \
  18. #attempt_download('weights/yolov5l.pt')"
  19. # --------------------------------------------------- Extras Below ---------------------------------------------------
  20. # Build and Push
  21. # t=ultralytics/yolov5:latest && sudo docker build -t $t . && sudo docker push $t
  22. # for v in {300..303}; do t=ultralytics/coco:v$v && sudo docker build -t $t . && sudo docker push $t; done
  23. # Pull and Run
  24. # t=ultralytics/yolov5:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all $t
  25. # Pull and Run with local directory access
  26. # t=ultralytics/yolov5:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all -v "$(pwd)"/coco:/usr/src/coco $t
  27. # Kill all
  28. # sudo docker kill $(sudo docker ps -q)
  29. # Kill all image-based
  30. # sudo docker kill $(sudo docker ps -qa --filter ancestor=ultralytics/yolov5:latest)
  31. # Bash into running container
  32. # sudo docker exec -it 5a9b5863d93d bash
  33. # Bash into stopped container
  34. # id=$(sudo docker ps -qa) && sudo docker start $id && sudo docker exec -it $id bash
  35. # Send weights to GCP
  36. # python -c "from utils.general import *; strip_optimizer('runs/train/exp0_*/weights/best.pt', 'tmp.pt')" && gsutil cp tmp.pt gs://*.pt
  37. # Clean up
  38. # docker system prune -a --volumes