Skip to content

Commit 5394cdf

Browse files
committed
init
0 parents  commit 5394cdf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4915
-0
lines changed

README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
## Classification
2+
3+
Train image classification on ImageNet
4+
5+
Use as many default commands as possible:
6+
7+
```
8+
python3 classify.py train <data_folder> -a dla34
9+
10+
```
11+
12+
With more data settings:
13+
```
14+
python3 classify.py train <data_folder> -a dla34 --data-name imagenet \
15+
--classes 1000 -j 4 --epochs 120 --start-epoch 0 --batch-size 256 \
16+
--crop-size 224 --scale-size 256
17+
```
18+
19+
If you want to train on a dataset that is not already defined in `dataset.py`, please specify a new data name and put `info.json` in the data folder. `info.json` contains a dictionary with required values `mean` and `std`, which are the mean and standard deviation of the images in the new dataset. A full set of options can be found in [`dataset.py`](dataset.py#L6). The other useful fields are `eigval` and `eigvec`, which are the eigen values and vectors for the image pixel variations in the dataset. A minimal `info.json` looks like:
20+
21+
```
22+
{
23+
"mean": [0.485, 0.456, 0.406],
24+
"std": [0.229, 0.224, 0.225]
25+
}
26+
```
27+
28+
If the new dataset contains 2 classes, the command can start with:
29+
30+
```
31+
python3 classify.py train <data_folder> -a dla34 --data-name new_data \
32+
--classes 2
33+
```
34+
35+
If you want to start your training with models pretrained on ImageNet and fine tune the model with learning rate 0.01, you can do
36+
37+
```
38+
python3 classify.py train <data_folder> -a dla34 --data-name new_data \
39+
--classes 2 --pretrained imagenet --lr 0.01
40+
```
41+
42+
## Segmentation and Boundary Prediction
43+
44+
Segmentation and boundary prediction data format is the same as
45+
[DRN](https://github.com/fyu/drn#prepare-data).
46+
47+
To use `--bn-sync`, please include `lib` in `PYTHONPATH`.
48+
49+
Cityscapes
50+
51+
```
52+
python3 segment.py train -d <data_folder> -c 19 -s 832 --arch dla102up \
53+
--scale 0 --batch-size 16 --lr 0.01 --momentum 0.9 --lr-mode poly \
54+
--epochs 500 --bn-sync --random-scale 2 --random-rotate 10 \
55+
--random-color --pretrained-base imagenet
56+
```
57+
58+
bn-sync is not necessary for CamVid and boundaries with 12GB GPU memory.
59+
60+
CamVid
61+
62+
```
63+
python3 segment.py train -d <data_folder> -c 11 -s 448 --arch dla102up \
64+
--scale 0 --batch-size 16 --epochs 1200 --lr 0.01 --momentum 0.9 \
65+
--step 800 --pretrained-base imagenet --random-scale 2 --random-rotate 10 \
66+
--random-color --save-feq 50
67+
```
68+
69+
BSDS
70+
71+
```
72+
python3 segment.py train -d <data_folder> -c 2 -s 416 --arch dla102up \
73+
--scale 0 --batch-size 16 --epochs 1200 --lr 0.01 --momentum 0.9 \
74+
--step 800 --pretrained-base imagenet --random-rotate 180 --random-color \
75+
--save-freq 50 --edge-weight 10 --bn-sync
76+
```
77+
78+
PASCAL Boundary
79+
80+
```
81+
python3 segment.py train -d <data_folder> -c 2 -s 480 --arch dla102up \
82+
--scale 0 --batch-size 32 --epochs 400 --lr 0.01 --momentum 0.9 \
83+
--step 200 --pretrained-base imagenet --random-rotate 10 --random-color \
84+
--save-freq 25 --edge-weight 10
85+
```
86+
87+
## FAQ
88+
89+
*How many GPUs does the program require for training?*
90+
91+
We tested all the training on GPUs with at least 12 GB memory. We usually tried to use fewest GPUs for the batch sizes. So the actually number of required GPUs is different between models, depending on the model sizes. Some model training may require 8 GPUs, such as training `dla102up` on Cityscapes dataset.

0 commit comments

Comments
 (0)