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.9 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
53
54
55
56
57
58
  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:21.05-py3
  4. # Install linux packages
  5. RUN apt update && apt install -y zip htop screen libgl1-mesa-glx
  6. # Install python dependencies
  7. COPY requirements.txt .
  8. RUN python -m pip install --upgrade pip
  9. RUN pip uninstall -y nvidia-tensorboard nvidia-tensorboard-plugin-dlprof
  10. RUN pip install --no-cache -r requirements.txt coremltools onnx gsutil notebook wandb>=0.12.2
  11. RUN pip install --no-cache -U torch torchvision numpy
  12. # RUN pip install --no-cache torch==1.9.0+cu111 torchvision==0.10.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html
  13. # Create working directory
  14. RUN mkdir -p /usr/src/app
  15. WORKDIR /usr/src/app
  16. # Copy contents
  17. COPY . /usr/src/app
  18. # Set environment variables
  19. ENV HOME=/usr/src/app
  20. # Usage Examples -------------------------------------------------------------------------------------------------------
  21. # Build and Push
  22. # t=ultralytics/yolov5:latest && sudo docker build -t $t . && sudo docker push $t
  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)"/datasets:/usr/src/datasets $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. # Clean up
  36. # docker system prune -a --volumes
  37. # Update Ubuntu drivers
  38. # https://www.maketecheasier.com/install-nvidia-drivers-ubuntu/
  39. # DDP test
  40. # python -m torch.distributed.run --nproc_per_node 2 --master_port 1 train.py --epochs 3
Tip!

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

Comments

Loading...