Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Dockerfile 1.8 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
  1. # Start FROM Nvidia PyTorch image https://ngc.nvidia.com/catalog/containers/nvidia:pytorch
  2. FROM nvcr.io/nvidia/pytorch:21.03-py3
  3. # Install linux packages
  4. RUN apt update && apt install -y zip htop screen libgl1-mesa-glx
  5. # Install python dependencies
  6. COPY requirements.txt .
  7. RUN python -m pip install --upgrade pip
  8. RUN pip uninstall -y nvidia-tensorboard nvidia-tensorboard-plugin-dlprof
  9. RUN pip install --no-cache -r requirements.txt coremltools onnx gsutil notebook
  10. # Create working directory
  11. RUN mkdir -p /usr/src/app
  12. WORKDIR /usr/src/app
  13. # Copy contents
  14. COPY . /usr/src/app
  15. # Set environment variables
  16. ENV HOME=/usr/src/app
  17. # --------------------------------------------------- Extras Below ---------------------------------------------------
  18. # Build and Push
  19. # t=ultralytics/yolov5:latest && sudo docker build -t $t . && sudo docker push $t
  20. # for v in {300..303}; do t=ultralytics/coco:v$v && sudo docker build -t $t . && sudo docker push $t; done
  21. # Pull and Run
  22. # t=ultralytics/yolov5:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all $t
  23. # Pull and Run with local directory access
  24. # t=ultralytics/yolov5:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all -v "$(pwd)"/coco:/usr/src/coco $t
  25. # Kill all
  26. # sudo docker kill $(sudo docker ps -q)
  27. # Kill all image-based
  28. # sudo docker kill $(sudo docker ps -qa --filter ancestor=ultralytics/yolov5:latest)
  29. # Bash into running container
  30. # sudo docker exec -it 5a9b5863d93d bash
  31. # Bash into stopped container
  32. # id=$(sudo docker ps -qa) && sudo docker start $id && sudo docker exec -it $id bash
  33. # Send weights to GCP
  34. # python -c "from utils.general import *; strip_optimizer('runs/train/exp0_*/weights/best.pt', 'tmp.pt')" && gsutil cp tmp.pt gs://*.pt
  35. # Clean up
  36. # docker system prune -a --volumes
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...