diff --git a/official/cv/googlenet/README.md b/official/cv/googlenet/README.md index d11fb0fd259551b5f861b415244f527f5072ae76..3fb862acb26bbd0954331d2494d5c8469c7d3f36 100644 --- a/official/cv/googlenet/README.md +++ b/official/cv/googlenet/README.md @@ -24,12 +24,12 @@ - [Inference](#inference) - [Model Description](#model-description) - [Performance](#performance) - - [Evaluation Performance](#evaluation-performance) - - [GoogleNet on CIFAR-10](#googlenet-on-cifar-10) - - [GoogleNet on 1200k images](#googlenet-on-1200k-images) + - [Training Performance](#training-performance) + - [GoogleNet train on CIFAR-10](#googlenet-train-on-cifar-10) + - [GoogleNet train on ImageNet2012](#googlenet-train-on-imagenet2012) - [Inference Performance](#inference-performance) - - [GoogleNet on CIFAR-10](#googlenet-on-cifar-10-1) - - [GoogleNet on 1200k images](#googlenet-on-1200k-images-1) + - [GoogleNet infer on CIFAR-10](#googlenet-infer-on-cifar-10) + - [GoogleNet infer on ImageNet2012](#googlenet-infer-on-imagenet2012) - [How to use](#how-to-use) - [Inference](#inference-1) - [Continue Training on the Pretrained Model](#continue-training-on-the-pretrained-model) @@ -59,12 +59,12 @@ Dataset used: [CIFAR-10](http://www.cs.toronto.edu/~kriz/cifar.html) - Data format锛歜inary files - Note锛欴ata will be processed in src/dataset.py -Dataset used can refer to paper. +Dataset used: [ImageNet2012](http://www.image-net.org/) -- Dataset size: 125G, 1250k colorful images in 1000 classes - - Train: 120G, 1200k images - - Test: 5G, 50k images -- Data format: RGB images. +- Dataset size: 224*224 colorful images in 1000 classes + - Train锛�1,281,167 images + - Test锛� 50,000 images +- Data format锛歫peg - Note: Data will be processed in src/dataset.py # [Features](#contents) @@ -519,9 +519,9 @@ Current batch_ Size can only be set to 1. ## [Performance](#contents) -### Evaluation Performance +### Training Performance -#### GoogleNet on CIFAR-10 +#### GoogleNet train on CIFAR-10 | Parameters | Ascend | GPU | | -------------------------- | ----------------------------------------------------------- | ---------------------- | @@ -542,7 +542,7 @@ Current batch_ Size can only be set to 1. | Model for inference | 21.50M (.onnx file), 21.60M(.air file) | | | Scripts | [googlenet script](https://gitee.com/mindspore/models/tree/master/official/cv/googlenet) | [googlenet script](https://gitee.com/mindspore/models/tree/master/official/cv/googlenet) | -#### GoogleNet on 1200k images +#### GoogleNet train on ImageNet2012 | Parameters | Ascend | | -------------------------- | ----------------------------------------------------------- | @@ -550,7 +550,7 @@ Current batch_ Size can only be set to 1. | Resource | Ascend 910; CPU 2.60GHz, 56cores; Memory 314G; OS Euler2.8 | | uploaded Date | 07/05/2021 (month/day/year) | | MindSpore Version | 1.3.0 | -| Dataset | 1200k images | +| Dataset | ImageNet2012 | | Training Parameters | epoch=300, steps=5000, batch_size=256, lr=0.1 | | Optimizer | Momentum | | Loss Function | Softmax Cross Entropy | @@ -564,7 +564,7 @@ Current batch_ Size can only be set to 1. ### Inference Performance -#### GoogleNet on CIFAR-10 +#### GoogleNet infer on CIFAR-10 | Parameters | Ascend | GPU | | ------------------- | --------------------------- | --------------------------- | @@ -578,7 +578,7 @@ Current batch_ Size can only be set to 1. | Accuracy | 1pc: 93.4%; 8pcs: 92.17% | 1pc: 93%, 8pcs: 92.89% | | Model for inference | 21.50M (.onnx file) | | -#### GoogleNet on 1200k images +#### GoogleNet infer on ImageNet2012 | Parameters | Ascend | | ------------------- | --------------------------- | @@ -586,7 +586,7 @@ Current batch_ Size can only be set to 1. | Resource | Ascend 910; OS Euler2.8 | | Uploaded Date | 07/05/2021 (month/day/year) | | MindSpore Version | 1.3.0 | -| Dataset | 1200k images | +| Dataset | ImageNet2012 | | batch_size | 256 | | outputs | probability | | Accuracy | 8pcs: 71.81% | diff --git a/official/cv/googlenet/README_CN.md b/official/cv/googlenet/README_CN.md index 510b1cb07e58c4f42e73c199b95fd922ea83b68e..d8f0e88856f6ca09d541eb6e7c3af7ad385c5c73 100644 --- a/official/cv/googlenet/README_CN.md +++ b/official/cv/googlenet/README_CN.md @@ -26,12 +26,12 @@ - [鎺ㄧ悊](#鎺ㄧ悊) - [妯″瀷鎻忚堪](#妯″瀷鎻忚堪) - [鎬ц兘](#鎬ц兘) + - [璁粌鎬ц兘](#璁粌鎬ц兘) + - [CIFAR-10涓婅缁僄oogleNet](#cifar-10涓婅缁僩ooglenet) + - [ImageNet2012涓婅缁僄oogleNet](#imagenet2012涓婅缁僩ooglenet) - [璇勪及鎬ц兘](#璇勪及鎬ц兘) - - [CIFAR-10涓婄殑GoogleNet](#cifar-10涓婄殑googlenet) - - [120涓囧紶鍥惧儚涓婄殑GoogleNet](#120涓囧紶鍥惧儚涓婄殑googlenet) - - [鎺ㄧ悊鎬ц兘](#鎺ㄧ悊鎬ц兘) - - [CIFAR-10涓婄殑GoogleNet](#cifar-10涓婄殑googlenet-1) - - [120涓囧紶鍥惧儚涓婄殑GoogleNet](#120涓囧紶鍥惧儚涓婄殑googlenet-1) + - [CIFAR-10涓婅瘎浼癎oogleNet](#cifar-10涓婅瘎浼癵ooglenet) + - [ImageNet2012涓婅瘎浼癎oogleNet](#imagenet2012涓婅瘎浼癵ooglenet) - [浣跨敤娴佺▼](#浣跨敤娴佺▼) - [鎺ㄧ悊](#鎺ㄧ悊-1) - [缁х画璁粌棰勮缁冩ā鍨媇(#缁х画璁粌棰勮缁冩ā鍨�) @@ -61,12 +61,12 @@ GoogleNet鐢卞涓猧nception妯″潡涓茶仈璧锋潵锛屽彲浠ユ洿鍔犳繁鍏ャ€� 闄嶇淮鐨� - 鏁版嵁鏍煎紡锛氫簩杩涘埗鏂囦欢 - 娉細鏁版嵁灏嗗湪src/dataset.py涓鐞嗐€� -鎵€鐢ㄦ暟鎹泦鍙弬鐓ц鏂囥€� +浣跨敤鐨勬暟鎹泦锛歔ImageNet2012](http://www.image-net.org/) -- 鏁版嵁闆嗗ぇ灏忥細125G锛屽叡1000涓被銆�125涓囧紶褰╄壊鍥惧儚 - - 璁粌闆嗭細120G锛屽叡120涓囧紶鍥惧儚 - - 娴嬭瘯闆嗭細5G锛屽叡5涓囧紶鍥惧儚 -- 鏁版嵁鏍煎紡锛歊GB +- 鏁版嵁闆嗗ぇ灏忥細鍏�1000涓被銆�224*224褰╄壊鍥惧儚 + - 璁粌闆嗭細鍏�1,281,167寮犲浘鍍� + - 娴嬭瘯闆嗭細鍏�50,000寮犲浘鍍� +- 鏁版嵁鏍煎紡锛欽PEG - 娉細鏁版嵁灏嗗湪src/dataset.py涓鐞嗐€� # 鐗规€� @@ -318,12 +318,44 @@ GoogleNet鐢卞涓猧nception妯″潡涓茶仈璧锋潵锛屽彲浠ユ洿鍔犳繁鍏ャ€� 闄嶇淮鐨� 'data_path':'./cifar10' # 璁粌鍜岃瘎浼版暟鎹泦鐨勭粷瀵瑰叏璺緞 'device_target':'Ascend' # 杩愯璁惧 'device_id':4 # 鐢ㄤ簬璁粌鎴栬瘎浼版暟鎹泦鐨勮澶嘔D浣跨敤run_train.sh杩涜鍒嗗竷寮忚缁冩椂鍙互蹇界暐銆� - 'keep_checkpoint_max':10 # 鍙繚瀛樻渶鍚庝竴涓猭eep_checkpoint_max妫€鏌ョ偣 + 'keep_checkpoint_max':10 # 鏈€澶氫繚瀛榗heckpoint鏂囦欢鐨勬暟閲� 'checkpoint_path':'./train_googlenet_cifar10-125_390.ckpt' # checkpoint鏂囦欢淇濆瓨鐨勭粷瀵瑰叏璺緞 'onnx_filename':'googlenet.onnx' # export.py涓娇鐢ㄧ殑onnx妯″瀷鏂囦欢鍚� 'geir_filename':'googlenet.geir' # export.py涓娇鐢ㄧ殑geir妯″瀷鏂囦欢鍚� ``` +- 閰嶇疆GoogleNet鍜孖mageNet2012鏁版嵁闆嗐€� + + ```python + 'pre_trained': 'False' # 鏄惁鍩轰簬棰勮缁冩ā鍨嬭缁� + 'num_classes': 1000 # 鏁版嵁闆嗙被鏁� + 'lr_init': 0.1 # 鍒濆瀛︿範鐜� + 'batch_size': 256 # 璁粌鎵规澶у皬 + 'epoch_size': 300 # 鎬昏璁粌epoch鏁� + 'momentum': 0.9 # 鍔ㄩ噺 + 'weight_decay': 1e-4 # 鏉冮噸琛板噺鍊� + 'image_height': 224 # 杈撳叆鍒版ā鍨嬬殑鍥惧儚楂樺害 + 'image_width': 224 # 杈撳叆鍒版ā鍨嬬殑鍥惧儚瀹藉害 + 'data_path': './ImageNet_Original/train/' # 璁粌鏁版嵁闆嗙殑缁濆鍏ㄨ矾寰� + 'val_data_path': './ImageNet_Original/val/' # 璇勪及鏁版嵁闆嗙殑缁濆鍏ㄨ矾寰� + 'device_target': 'Ascend' # 杩愯绋嬪簭鐨勭洰鏍囪澶� + 'device_id': 0 # 璁粌鎴栬€呰瘎浼颁娇鐢ㄧ殑璁惧鍗″彿銆� 濡傛灉鏄垎甯冨紡璁粌锛屽拷鐣ヨ鍙傛暟銆� + 'keep_checkpoint_max': 10 # 鏈€澶氫繚瀛榗heckpoint鏂囦欢鐨勬暟閲� + 'checkpoint_path': './train_googlenet_cifar10-125_390.ckpt' # 淇濆瓨checkpoint鏂囦欢鐨勭粷瀵瑰叏璺緞 + 'onnx_filename': 'googlenet.onnx' # export.py浣跨敤鐨刼nnx妯″瀷鐨勬枃浠跺悕 + 'air_filename': 'googlenet.air' # export.py浣跨敤鐨刟ir妯″瀷鐨勬枃浠跺悕 + 'lr_scheduler': 'exponential' # 瀛︿範鐜囪皟搴﹀櫒 + 'lr_epochs': [70, 140, 210, 280] # lr鏀瑰彉鐨別poch鏁� + 'lr_gamma': 0.3 # 鎸囨暟琛板噺瀛︿範鐜囪皟搴﹀櫒瀛︿範鐜囪“鍑忓洜瀛� + 'eta_min': 0.0 # 浣欏鸡閫€鐏涔犵巼璋冨害鍣ㄧ殑鏈€灏忓涔犵巼 + 'T_max': 150 # 浣欏鸡閫€鐏涔犵巼璋冨害鍣╟os鍛ㄦ湡鐨�1/2 + 'warmup_epochs': 0 # 瀛︿範鐜囬鐑璭poch鏁� + 'is_dynamic_loss_scale': 0 # 鏄惁鏄姩鎬乴oss scale + 'loss_scale': 1024 # loss scale + 'label_smooth_factor': 0.1 # 鏍囩骞虫粦鍥犲瓙 + 'use_label_smooth': True # 鏍囩骞虫粦 + ``` + 鏇村閰嶇疆缁嗚妭璇峰弬鑰冭剼鏈琡config.py`銆� ## 璁粌杩囩▼ @@ -488,9 +520,9 @@ python export.py --config_path [CONFIG_PATH] ## 鎬ц兘 -### 璇勪及鎬ц兘 +### 璁粌鎬ц兘 -#### CIFAR-10涓婄殑GoogleNet +#### CIFAR-10涓婅缁僄oogleNet | 鍙傛暟 | Ascend | GPU | | -------------------------- | ----------------------------------------------------------- | ---------------------- | @@ -511,7 +543,7 @@ python export.py --config_path [CONFIG_PATH] | 鎺ㄧ悊妯″瀷 | 21.50M (.onnx鏂囦欢), 21.60M(.air鏂囦欢) | | | 鑴氭湰 | [googlenet鑴氭湰](https://gitee.com/mindspore/mindspore/tree/r0.7/model_zoo/official/cv/googlenet) | [googlenet 鑴氭湰](https://gitee.com/mindspore/mindspore/tree/r0.6/model_zoo/official/cv/googlenet) | -#### 120涓囧紶鍥惧儚涓婄殑GoogleNet +#### ImageNet2012涓婅缁僄oogleNet | 鍙傛暟 | Ascend | | -------------------------- | ----------------------------------------------------------- | @@ -519,7 +551,7 @@ python export.py --config_path [CONFIG_PATH] | 璧勬簮 | Ascend 910锛汣PU 2.60GHz锛�56鏍革紱鍐呭瓨 314G锛涚郴缁� Euler2.8 | | 涓婁紶鏃ユ湡 | 2021-07-05 | | MindSpore鐗堟湰 | 1.3.0 | -| 鏁版嵁闆� | 120涓囧紶鍥惧儚 | +| 鏁版嵁闆� | ImageNet2012 | | 璁粌鍙傛暟 | epoch=300, steps=5000, batch_size=256, lr=0.1 | | 浼樺寲鍣� | Momentum | | 鎹熷け鍑芥暟 | Softmax浜ゅ弶鐔� | @@ -531,9 +563,9 @@ python export.py --config_path [CONFIG_PATH] | 寰皟妫€鏌ョ偣 | 52M (.ckpt鏂囦欢) | | 鑴氭湰 | [googlenet鑴氭湰](https://gitee.com/mindspore/mindspore/tree/r0.7/model_zoo/official/cv/googlenet) | -### 鎺ㄧ悊鎬ц兘 +### 璇勪及鎬ц兘 -#### CIFAR-10涓婄殑GoogleNet +#### CIFAR-10涓婅瘎浼癎oogleNet | 鍙傛暟 | Ascend | GPU | | ------------------- | --------------------------- | --------------------------- | @@ -547,7 +579,7 @@ python export.py --config_path [CONFIG_PATH] | 鍑嗙‘鎬� | 鍗曞崱: 93.4%; 8鍗★細92.17% | 鍗曞崱锛�93%, 8鍗★細92.89% | | 鎺ㄧ悊妯″瀷 | 21.50M (.onnx鏂囦欢) | | -#### 120涓囧紶鍥惧儚涓婄殑GoogleNet +#### ImageNet2012涓婅瘎浼癎oogleNet | 鍙傛暟 | Ascend | | ------------------- | --------------------------- | @@ -555,7 +587,7 @@ python export.py --config_path [CONFIG_PATH] | 璧勬簮 | Ascend 910锛涚郴缁� Euler2.8 | | 涓婁紶鏃ユ湡 | 2021-07-05 | | MindSpore鐗堟湰 | 1.3.0 | -| 鏁版嵁闆� | 12涓囧紶鍥惧儚 | +| 鏁版嵁闆� | ImageNet2012 | | batch_size | 256 | | 杈撳嚭 | 姒傜巼 | | 鍑嗙‘鎬� | 8鍗�: 71.81% |