Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

54 Zeilen
1.9KB

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