Newer
Older
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
## Prerequisites
- Python 3.6+
- PyTorch 1.6+
- CUDA 9.2+
- GCC 5.4+
## Prepare the Environment
1. Use conda and activate the environment:
```bash
conda create -n open-mmlab python=3.7 -y
conda activate open-mmlab
```
2. Install PyTorch
Before installing `MMEngine`, please make sure that PyTorch has been successfully installed in the environment. You can refer to [PyTorch official installation documentation](https://pytorch.org/get-started/locally/#start-locally). Verify the installation with the following command:
```bash
python -c 'import torch;print(torch.__version__)'
```
## Install MMEngine
### Install with mim
[mim](https://github.com/open-mmlab/mim) is a package management tool for OpenMMLab projects, which can be used to install the OpenMMLab project easily.
```bash
pip install -U openmim
mim install mmengine
```
### Install with pip
```bash
pip install mmengine
```
### Use docker images
1. Build the image
```bash
docker build -t mmengine https://github.com/open-mmlab/mmengine.git#main:docker/release
```
More information can be referred from [mmengine/docker](https://github.com/open-mmlab/mmengine/tree/main/docker).
2. Run the image
```bash
docker run --gpus all --shm-size=8g -it mmengine
```
#### Build from source
```bash
# if cloning speed is too slow, you can switch the source to https://gitee.com/open-mmlab/mmengine.git
git clone https://github.com/open-mmlab/mmengine.git
cd mmengine
pip install -e . -v
```
### Verify the Installation
To verify if `MMEngine` and the necessary environment are successfully installed, we can run this command:
```bash
python -c 'import mmengine;print(mmengine.__version__)'
```