Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
Genius Patrick c0aa519f4e | 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.
Model | Context | Top-1 (%) | Top-5 (%) | Params (M) | Train T. | Infer T. | Download | Config | Log |
---|---|---|---|---|---|---|---|---|---|
DenseNet121 | D910x8-G | 75.64 | 92.84 | 8.06 | 238s/epoch | 6.7ms/step | model | cfg | log |
DenseNet161 | D910x8-G | 79.09 | 94.66 | 28.90 | 472s/epoch | 8.7ms/step | model | cfg | log |
DenseNet169 | D910x8-G | 77.26 | 93.71 | 14.30 | 313s/epoch | 7.4ms/step | model | cfg | log |
DenseNet201 | D910x8-G | 78.14 | 94.08 | 20.24 | 394s/epoch | 7.9ms/step | model | cfg | log |
Please refer to the installation instruction in MindCV.
Please download the ImageNet-1K dataset for model training and validation.
Hyper-parameters. The hyper-parameter configurations for producing the reported results are stored in the yaml files in mindcv/configs/densenet
folder. For example, to train with one of these configurations, you can run:
# train densenet121 on 8 GPUs
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
Note that the number of GPUs/Ascends and batch size will influence the training results. To reproduce the training result at most, it is recommended to use the same number of GPUs/Ascneds with the same batch size.
Finetuning. Here is an 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 trained 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'
Please refer to the deployment tutorial in MindCV.
No Description
Jupyter Notebook Python Markdown Text
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》