qujialing c3003882de | 1 year ago | |
---|---|---|
.. | ||
README.md | 1 year ago | |
README_CN.md | 1 year ago | |
densenet.png | 1 year ago | |
densenet_121_ascend.yaml | 1 year ago | |
densenet_121_gpu.yaml | 1 year ago | |
densenet_161_ascend.yaml | 1 year ago | |
densenet_161_gpu.yaml | 1 year ago | |
densenet_169_ascend.yaml | 1 year ago | |
densenet_169_gpu.yaml | 1 year ago | |
densenet_201_ascend.yaml | 1 year ago | |
densenet_201_gpu.yaml | 1 year ago |
Recent work has shown that convolutional networks can be substantially deeper, more accurate, and efficient to train if
they contain shorter connections between layers close to the input and those close to the output. Dense Convolutional
Network (DenseNet) is introduced based on this observation, which connects each layer to every other layer in a
feed-forward fashion. Whereas traditional convolutional networks with $L$ layers have $L$ connections-one between each
layer and its subsequent layer, our network has $\frac{L(L+1)}{2}$ direct connections. For each layer, the feature-maps
of all preceding layers are used as inputs, and its own feature-maps are used as inputs into all subsequent layers.
DenseNets have several compelling advantages: they alleviate the vanishing-gradient problem, strengthen feature
propagation, encourage feature reuse, and substantially reduce the number of parameters.
Pynative | Pynative | Graph | Graph | ||||||
---|---|---|---|---|---|---|---|---|---|
Model | Top-1 (%) | Top-5 (%) | train (s/epoch) | Infer (ms) | train(s/epoch) | Infer (ms) | Download | Config | |
GPU | DenseNet121 | 75.60 | 92.73 | model | config | ||||
Ascend | DenseNet121 | 75.60 | 92.73 | ||||||
GPU | DenseNet161 | 79.10 | 94.65 | model | config | ||||
Ascend | DenseNet161 | 79.10 | 94.64 | ||||||
GPU | DenseNet169 | 76.38 | 93.34 | model | config | ||||
Ascend | DenseNet169 | 76.37 | 93.33 | ||||||
GPU | DenseNet201 | 78.08 | 94.13 | model | config | ||||
Ascend | DenseNet201 | 78.08 | 94.12 |
The yaml config files that yield competitive results on ImageNet for different models are listed in
the configs
folder. To trigger training using preset yaml config.
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
mpirun -n 8 python train.py -c configs/densenet/densenet_121_gpu.yaml --data_dir /path/to/imagenet
Here is the example for finetuning a pretrained densenet121 on CIFAR10 dataset using Momentum optimizer.
python train.py --model=densenet121 --pretrained --opt=momentum --lr=0.001 dataset=cifar10 --num_classes=10 --dataset_download
Detailed adjustable parameters and their default value can be seen in config.py.
To validate the model, you can use validate.py
. Here is an example for densenet121 to verify the accuracy of
pretrained weights.
python validate.py --model=densenet121 --dataset=imagenet --val_split=val --pretrained
To validate the model, you can use validate.py
. Here is an example for densenet121 to verify the accuracy of your
training.
python validate.py --model=densenet121 --dataset=imagenet --val_split=val --ckpt_path='./ckpt/densenet121-best.ckpt'
No Description
Jupyter Notebook Python Markdown Text other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》