Res2Net101_v1b

This implements training of Res2Net101_v1b on the ImageNet dataset, mainly modified from pytorch/examples.

Res2Net101_v1b Detail

Requirements

Install PyTorch (pytorch.org) pip install -r requirements.txt Note: pillow recommends installing a newer version. If the corresponding torchvision version cannot be installed directly, you can use the source code to install the corresponding version. The source code reference link: Suggestion the pillow is 9.1.0 and the torchvision is 0.6.0 Download the ImageNet dataset from http://www.image-net.org/ Then, and move validation images to labeled subfolders, using [the following shell script]

Training

To train a model, run main.py with the desired model architecture and the path to the ImageNet dataset:

1p training 1p

bash ./test/train_full_1p.sh --data_path=xxx # training accuracy

bash ./test/train_performance_1p.sh --data_path=xxx # training performance

8p training 8p

bash ./test/train_full_8p.sh --data_path=xxx # training accuracy

bash ./test/train_performance_8p.sh --data_path=xxx # training performance

eval default 8p, should support 1p

bash ./test/train_eval_8p.sh --data_path=xxx

O2 online inference demo

source scripts/set_npu_env.sh python3 demo.py

O2 To ONNX

source scripts/set_npu_env.sh python3 pthtar2onnx.py

Res2Net101_v1b training result

Acc@1 FPS Npu_nums Epochs AMP_Type
- 383.472 1 1 O2
79.034 2611.314 8 100 O2

Copyright 2020 Huawei Technologies Co., Ltd

Licensed under the Apache License, Version 2.0 (the "License");

you may not use this file except in compliance with the License.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

============================================================================

@article{gao2019res2net, title={Res2Net: A New Multi-scale Backbone Architecture}, author={Gao, Shang-Hua and Cheng, Ming-Ming and Zhao, Kai and Zhang, Xin-Yu and Yang, Ming-Hsuan and Torr, Philip}, journal={IEEE TPAMI}, year={2021}, doi={10.1109/TPAMI.2019.2938758}, }

公网地址说明

代码涉及公网地址参考 public_address_statement.md