Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
6b261a52
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
大约 1 年 前同步成功
通知
115
Star
4999
Fork
1114
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
6
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleClas
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
6
合并请求
6
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
6b261a52
编写于
4月 20, 2020
作者:
D
dyning
提交者:
GitHub
4月 20, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #49 from littletomatodonkey/qs_code
add quick start demo
上级
5bf15d87
9f3432f5
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
368 addition
and
8 deletion
+368
-8
configs/quick_start/MobileNetV3_large_x1_0_finetune.yaml
configs/quick_start/MobileNetV3_large_x1_0_finetune.yaml
+70
-0
configs/quick_start/R50_vd_distill_MV3_large_x1_0.yaml
configs/quick_start/R50_vd_distill_MV3_large_x1_0.yaml
+75
-0
configs/quick_start/ResNet50_vd.yaml
configs/quick_start/ResNet50_vd.yaml
+70
-0
configs/quick_start/ResNet50_vd_finetune.yaml
configs/quick_start/ResNet50_vd_finetune.yaml
+70
-0
configs/quick_start/ResNet50_vd_ssld_finetune.yaml
configs/quick_start/ResNet50_vd_ssld_finetune.yaml
+2
-4
configs/quick_start/ResNet50_vd_ssld_random_erasing_finetune.yaml
...quick_start/ResNet50_vd_ssld_random_erasing_finetune.yaml
+74
-0
ppcls/modeling/architectures/__init__.py
ppcls/modeling/architectures/__init__.py
+1
-1
ppcls/modeling/architectures/distillation_models.py
ppcls/modeling/architectures/distillation_models.py
+2
-2
ppcls/utils/save_load.py
ppcls/utils/save_load.py
+4
-1
未找到文件。
configs/quick_start/MobileNetV3_large_x1_0_finetune.yaml
0 → 100644
浏览文件 @
6b261a52
mode
:
'
train'
ARCHITECTURE
:
name
:
'
MobileNetV3_large_x1_0'
pretrained_model
:
"
./pretrained/MobileNetV3_large_x1_0_pretrained"
model_save_dir
:
"
./output/"
classes_num
:
102
total_images
:
1020
save_interval
:
1
validate
:
True
valid_interval
:
1
epochs
:
20
topk
:
5
image_shape
:
[
3
,
224
,
224
]
LEARNING_RATE
:
function
:
'
Cosine'
params
:
lr
:
0.00375
OPTIMIZER
:
function
:
'
Momentum'
params
:
momentum
:
0.9
regularizer
:
function
:
'
L2'
factor
:
0.000001
TRAIN
:
batch_size
:
32
num_workers
:
4
file_list
:
"
./dataset/flowers102/train_list.txt"
data_dir
:
"
./dataset/flowers102/"
shuffle_seed
:
0
transforms
:
-
DecodeImage
:
to_rgb
:
True
to_np
:
False
channel_first
:
False
-
RandCropImage
:
size
:
224
-
RandFlipImage
:
flip_code
:
1
-
NormalizeImage
:
scale
:
1./255.
mean
:
[
0.485
,
0.456
,
0.406
]
std
:
[
0.229
,
0.224
,
0.225
]
order
:
'
'
-
ToCHWImage
:
VALID
:
batch_size
:
20
num_workers
:
4
file_list
:
"
./dataset/flowers102/val_list.txt"
data_dir
:
"
./dataset/flowers102/"
shuffle_seed
:
0
transforms
:
-
DecodeImage
:
to_rgb
:
True
to_np
:
False
channel_first
:
False
-
ResizeImage
:
resize_short
:
256
-
CropImage
:
size
:
224
-
NormalizeImage
:
scale
:
1.0/255.0
mean
:
[
0.485
,
0.456
,
0.406
]
std
:
[
0.229
,
0.224
,
0.225
]
order
:
'
'
-
ToCHWImage
:
configs/quick_start/R50_vd_distill_MV3_large_x1_0.yaml
0 → 100644
浏览文件 @
6b261a52
mode
:
'
train'
ARCHITECTURE
:
name
:
'
ResNet50_vd_distill_MobileNetV3_large_x1_0'
pretrained_model
:
-
"
./pretrain/flowers102_R50_vd_final/ppcls"
-
"
./pretrained/MobileNetV3_large_x1_0_pretrained/"
model_save_dir
:
"
./output/"
classes_num
:
102
total_images
:
7169
save_interval
:
1
validate
:
True
valid_interval
:
1
epochs
:
20
topk
:
5
image_shape
:
[
3
,
224
,
224
]
use_distillation
:
True
LEARNING_RATE
:
function
:
'
Cosine'
params
:
lr
:
0.0125
OPTIMIZER
:
function
:
'
Momentum'
params
:
momentum
:
0.9
regularizer
:
function
:
'
L2'
factor
:
0.00007
TRAIN
:
batch_size
:
32
num_workers
:
4
file_list
:
"
./dataset/flowers102/train_test_list.txt"
data_dir
:
"
./dataset/flowers102/"
shuffle_seed
:
0
transforms
:
-
DecodeImage
:
to_rgb
:
True
to_np
:
False
channel_first
:
False
-
RandCropImage
:
size
:
224
-
RandFlipImage
:
flip_code
:
1
-
NormalizeImage
:
scale
:
1./255.
mean
:
[
0.485
,
0.456
,
0.406
]
std
:
[
0.229
,
0.224
,
0.225
]
order
:
'
'
-
ToCHWImage
:
VALID
:
batch_size
:
20
num_workers
:
4
file_list
:
"
./dataset/flowers102/val_list.txt"
data_dir
:
"
./dataset/flowers102/"
shuffle_seed
:
0
transforms
:
-
DecodeImage
:
to_rgb
:
True
to_np
:
False
channel_first
:
False
-
ResizeImage
:
resize_short
:
256
-
CropImage
:
size
:
224
-
NormalizeImage
:
scale
:
1.0/255.0
mean
:
[
0.485
,
0.456
,
0.406
]
std
:
[
0.229
,
0.224
,
0.225
]
order
:
'
'
-
ToCHWImage
:
configs/quick_start/ResNet50_vd.yaml
0 → 100644
浏览文件 @
6b261a52
mode
:
'
train'
ARCHITECTURE
:
name
:
'
ResNet50_vd'
pretrained_model
:
"
"
model_save_dir
:
"
./output/"
classes_num
:
102
total_images
:
1020
save_interval
:
1
validate
:
True
valid_interval
:
1
epochs
:
20
topk
:
5
image_shape
:
[
3
,
224
,
224
]
LEARNING_RATE
:
function
:
'
Cosine'
params
:
lr
:
0.0125
OPTIMIZER
:
function
:
'
Momentum'
params
:
momentum
:
0.9
regularizer
:
function
:
'
L2'
factor
:
0.00001
TRAIN
:
batch_size
:
32
num_workers
:
4
file_list
:
"
./dataset/flowers102/train_list.txt"
data_dir
:
"
./dataset/flowers102/"
shuffle_seed
:
0
transforms
:
-
DecodeImage
:
to_rgb
:
True
to_np
:
False
channel_first
:
False
-
RandCropImage
:
size
:
224
-
RandFlipImage
:
flip_code
:
1
-
NormalizeImage
:
scale
:
1./255.
mean
:
[
0.485
,
0.456
,
0.406
]
std
:
[
0.229
,
0.224
,
0.225
]
order
:
'
'
-
ToCHWImage
:
VALID
:
batch_size
:
20
num_workers
:
4
file_list
:
"
./dataset/flowers102/val_list.txt"
data_dir
:
"
./dataset/flowers102/"
shuffle_seed
:
0
transforms
:
-
DecodeImage
:
to_rgb
:
True
to_np
:
False
channel_first
:
False
-
ResizeImage
:
resize_short
:
256
-
CropImage
:
size
:
224
-
NormalizeImage
:
scale
:
1.0/255.0
mean
:
[
0.485
,
0.456
,
0.406
]
std
:
[
0.229
,
0.224
,
0.225
]
order
:
'
'
-
ToCHWImage
:
configs/quick_start/ResNet50_vd_finetune.yaml
0 → 100644
浏览文件 @
6b261a52
mode
:
'
train'
ARCHITECTURE
:
name
:
'
ResNet50_vd'
pretrained_model
:
"
./pretrained/ResNet50_vd_pretrained"
model_save_dir
:
"
./output/"
classes_num
:
102
total_images
:
1020
save_interval
:
1
validate
:
True
valid_interval
:
1
epochs
:
20
topk
:
5
image_shape
:
[
3
,
224
,
224
]
LEARNING_RATE
:
function
:
'
Cosine'
params
:
lr
:
0.00375
OPTIMIZER
:
function
:
'
Momentum'
params
:
momentum
:
0.9
regularizer
:
function
:
'
L2'
factor
:
0.000001
TRAIN
:
batch_size
:
32
num_workers
:
4
file_list
:
"
./dataset/flowers102/train_list.txt"
data_dir
:
"
./dataset/flowers102/"
shuffle_seed
:
0
transforms
:
-
DecodeImage
:
to_rgb
:
True
to_np
:
False
channel_first
:
False
-
RandCropImage
:
size
:
224
-
RandFlipImage
:
flip_code
:
1
-
NormalizeImage
:
scale
:
1./255.
mean
:
[
0.485
,
0.456
,
0.406
]
std
:
[
0.229
,
0.224
,
0.225
]
order
:
'
'
-
ToCHWImage
:
VALID
:
batch_size
:
20
num_workers
:
4
file_list
:
"
./dataset/flowers102/val_list.txt"
data_dir
:
"
./dataset/flowers102/"
shuffle_seed
:
0
transforms
:
-
DecodeImage
:
to_rgb
:
True
to_np
:
False
channel_first
:
False
-
ResizeImage
:
resize_short
:
256
-
CropImage
:
size
:
224
-
NormalizeImage
:
scale
:
1.0/255.0
mean
:
[
0.485
,
0.456
,
0.406
]
std
:
[
0.229
,
0.224
,
0.225
]
order
:
'
'
-
ToCHWImage
:
configs/
finetune
/ResNet50_vd_ssld_finetune.yaml
→
configs/
quick_start
/ResNet50_vd_ssld_finetune.yaml
浏览文件 @
6b261a52
...
...
@@ -10,12 +10,10 @@ total_images: 1020
save_interval
:
1
validate
:
True
valid_interval
:
1
epochs
:
4
0
epochs
:
2
0
topk
:
5
image_shape
:
[
3
,
224
,
224
]
ls_epsilon
:
0.1
LEARNING_RATE
:
function
:
'
Cosine'
params
:
...
...
@@ -52,7 +50,7 @@ TRAIN:
-
ToCHWImage
:
VALID
:
batch_size
:
32
batch_size
:
20
num_workers
:
4
file_list
:
"
./dataset/flowers102/val_list.txt"
data_dir
:
"
./dataset/flowers102/"
...
...
configs/quick_start/ResNet50_vd_ssld_random_erasing_finetune.yaml
0 → 100644
浏览文件 @
6b261a52
mode
:
'
train'
ARCHITECTURE
:
name
:
'
ResNet50_vd'
params
:
lr_mult_list
:
[
0.1
,
0.1
,
0.2
,
0.2
,
0.3
]
pretrained_model
:
"
./pretrained/ResNet50_vd_ssld_pretrained"
model_save_dir
:
"
./output/"
classes_num
:
102
total_images
:
1020
save_interval
:
1
validate
:
True
valid_interval
:
1
epochs
:
20
topk
:
5
image_shape
:
[
3
,
224
,
224
]
LEARNING_RATE
:
function
:
'
Cosine'
params
:
lr
:
0.00375
OPTIMIZER
:
function
:
'
Momentum'
params
:
momentum
:
0.9
regularizer
:
function
:
'
L2'
factor
:
0.000001
TRAIN
:
batch_size
:
32
num_workers
:
4
file_list
:
"
./dataset/flowers102/train_list.txt"
data_dir
:
"
./dataset/flowers102/"
shuffle_seed
:
0
transforms
:
-
DecodeImage
:
to_rgb
:
True
to_np
:
False
channel_first
:
False
-
RandCropImage
:
size
:
224
-
RandFlipImage
:
flip_code
:
1
-
NormalizeImage
:
scale
:
1./255.
mean
:
[
0.485
,
0.456
,
0.406
]
std
:
[
0.229
,
0.224
,
0.225
]
order
:
'
'
-
RandomErasing
:
EPSILON
:
0.5
-
ToCHWImage
:
VALID
:
batch_size
:
20
num_workers
:
4
file_list
:
"
./dataset/flowers102/val_list.txt"
data_dir
:
"
./dataset/flowers102/"
shuffle_seed
:
0
transforms
:
-
DecodeImage
:
to_rgb
:
True
to_np
:
False
channel_first
:
False
-
ResizeImage
:
resize_short
:
256
-
CropImage
:
size
:
224
-
NormalizeImage
:
scale
:
1.0/255.0
mean
:
[
0.485
,
0.456
,
0.406
]
std
:
[
0.229
,
0.224
,
0.225
]
order
:
'
'
-
ToCHWImage
:
ppcls/modeling/architectures/__init__.py
浏览文件 @
6b261a52
...
...
@@ -44,4 +44,4 @@ from .darts_gs import DARTS_GS_6M, DARTS_GS_4M
from
.resnet_acnet
import
ResNet18_ACNet
,
ResNet34_ACNet
,
ResNet50_ACNet
,
ResNet101_ACNet
,
ResNet152_ACNet
# distillation model
from
.distillation_models
import
ResNet50_vd_distill_MobileNetV3_x1_0
,
ResNeXt101_32x16d_wsl_distill_ResNet50_vd
from
.distillation_models
import
ResNet50_vd_distill_MobileNetV3_
large_
x1_0
,
ResNeXt101_32x16d_wsl_distill_ResNet50_vd
ppcls/modeling/architectures/distillation_models.py
浏览文件 @
6b261a52
...
...
@@ -27,12 +27,12 @@ from .mobilenet_v3 import MobileNetV3_large_x1_0
from
.resnext101_wsl
import
ResNeXt101_32x16d_wsl
__all__
=
[
'ResNet50_vd_distill_MobileNetV3_x1_0'
,
'ResNet50_vd_distill_MobileNetV3_
large_
x1_0'
,
'ResNeXt101_32x16d_wsl_distill_ResNet50_vd'
]
class
ResNet50_vd_distill_MobileNetV3_x1_0
():
class
ResNet50_vd_distill_MobileNetV3_
large_
x1_0
():
def
net
(
self
,
input
,
class_dim
=
1000
):
# student
student
=
MobileNetV3_large_x1_0
()
...
...
ppcls/utils/save_load.py
浏览文件 @
6b261a52
...
...
@@ -118,7 +118,10 @@ def init_model(config, program, exe):
pretrained_model
=
config
.
get
(
'pretrained_model'
)
if
pretrained_model
:
load_params
(
exe
,
program
,
pretrained_model
)
if
not
isinstance
(
pretrained_model
,
list
):
pretrained_model
=
[
pretrained_model
]
for
pretrain
in
pretrained_model
:
load_params
(
exe
,
program
,
pretrain
)
logger
.
info
(
"Finish initing model from {}"
.
format
(
pretrained_model
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录