Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleX
提交
f02f0476
P
PaddleX
项目概览
PaddlePaddle
/
PaddleX
通知
138
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
43
列表
看板
标记
里程碑
合并请求
5
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleX
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
43
Issue
43
列表
看板
标记
里程碑
合并请求
5
合并请求
5
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f02f0476
编写于
5月 05, 2020
作者:
J
jiangjiajun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify load model
上级
2868f100
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
20 addition
and
29 deletion
+20
-29
paddlex/cv/models/classifier.py
paddlex/cv/models/classifier.py
+15
-17
paddlex/cv/models/deeplabv3p.py
paddlex/cv/models/deeplabv3p.py
+1
-3
paddlex/cv/models/faster_rcnn.py
paddlex/cv/models/faster_rcnn.py
+1
-3
paddlex/cv/models/load_model.py
paddlex/cv/models/load_model.py
+1
-0
paddlex/cv/models/mask_rcnn.py
paddlex/cv/models/mask_rcnn.py
+1
-3
paddlex/cv/models/yolo_v3.py
paddlex/cv/models/yolo_v3.py
+1
-3
未找到文件。
paddlex/cv/models/classifier.py
浏览文件 @
f02f0476
...
...
@@ -129,9 +129,7 @@ class BaseClassifier(BaseAPI):
ValueError: 模型从inference model进行加载。
"""
if
not
self
.
trainable
:
raise
ValueError
(
"Model is not trainable since it was loaded from a inference model."
)
raise
ValueError
(
"Model is not trainable from load_model method."
)
self
.
labels
=
train_dataset
.
labels
if
optimizer
is
None
:
num_steps_each_epoch
=
train_dataset
.
num_samples
//
train_batch_size
...
...
@@ -300,17 +298,18 @@ class ResNet101_vd(BaseClassifier):
def
__init__
(
self
,
num_classes
=
1000
):
super
(
ResNet101_vd
,
self
).
__init__
(
model_name
=
'ResNet101_vd'
,
num_classes
=
num_classes
)
class
ResNet50_vd_ssld
(
BaseClassifier
):
def
__init__
(
self
,
num_classes
=
1000
):
super
(
ResNet50_vd_ssld
,
self
).
__init__
(
model_name
=
'ResNet50_vd_ssld'
,
num_classes
=
num_classes
)
super
(
ResNet50_vd_ssld
,
self
).
__init__
(
model_name
=
'ResNet50_vd_ssld'
,
num_classes
=
num_classes
)
class
ResNet101_vd_ssld
(
BaseClassifier
):
def
__init__
(
self
,
num_classes
=
1000
):
super
(
ResNet101_vd_ssld
,
self
).
__init__
(
model_name
=
'ResNet101_vd_ssld'
,
num_classes
=
num_classes
)
super
(
ResNet101_vd_ssld
,
self
).
__init__
(
model_name
=
'ResNet101_vd_ssld'
,
num_classes
=
num_classes
)
class
DarkNet53
(
BaseClassifier
):
...
...
@@ -341,19 +340,18 @@ class MobileNetV3_large(BaseClassifier):
def
__init__
(
self
,
num_classes
=
1000
):
super
(
MobileNetV3_large
,
self
).
__init__
(
model_name
=
'MobileNetV3_large'
,
num_classes
=
num_classes
)
class
MobileNetV3_small_ssld
(
BaseClassifier
):
def
__init__
(
self
,
num_classes
=
1000
):
super
(
MobileNetV3_small_ssld
,
self
).
__init__
(
model_name
=
'MobileNetV3_small_ssld'
,
num_classes
=
num_classes
)
super
(
MobileNetV3_small_ssld
,
self
).
__init__
(
model_name
=
'MobileNetV3_small_ssld'
,
num_classes
=
num_classes
)
class
MobileNetV3_large_ssld
(
BaseClassifier
):
def
__init__
(
self
,
num_classes
=
1000
):
super
(
MobileNetV3_large_ssld
,
self
).
__init__
(
model_name
=
'MobileNetV3_large_ssld'
,
num_classes
=
num_classes
)
super
(
MobileNetV3_large_ssld
,
self
).
__init__
(
model_name
=
'MobileNetV3_large_ssld'
,
num_classes
=
num_classes
)
class
Xception65
(
BaseClassifier
):
...
...
paddlex/cv/models/deeplabv3p.py
浏览文件 @
f02f0476
...
...
@@ -257,9 +257,7 @@ class DeepLabv3p(BaseAPI):
ValueError: 模型从inference model进行加载。
"""
if
not
self
.
trainable
:
raise
ValueError
(
"Model is not trainable since it was loaded from a inference model."
)
raise
ValueError
(
"Model is not trainable from load_model method."
)
self
.
labels
=
train_dataset
.
labels
...
...
paddlex/cv/models/faster_rcnn.py
浏览文件 @
f02f0476
...
...
@@ -203,9 +203,7 @@ class FasterRCNN(BaseAPI):
assert
metric
in
[
'COCO'
,
'VOC'
],
"Metric only support 'VOC' or 'COCO'"
self
.
metric
=
metric
if
not
self
.
trainable
:
raise
ValueError
(
"Model is not trainable since it was loaded from a inference model."
)
raise
ValueError
(
"Model is not trainable from load_model method."
)
self
.
labels
=
copy
.
deepcopy
(
train_dataset
.
labels
)
self
.
labels
.
insert
(
0
,
'background'
)
# 构建训练网络
...
...
paddlex/cv/models/load_model.py
浏览文件 @
f02f0476
...
...
@@ -98,6 +98,7 @@ def load_model(model_dir):
model
.
__dict__
[
k
]
=
v
logging
.
info
(
"Model[{}] loaded."
.
format
(
info
[
'Model'
]))
model
.
trainable
=
False
return
model
...
...
paddlex/cv/models/mask_rcnn.py
浏览文件 @
f02f0476
...
...
@@ -165,9 +165,7 @@ class MaskRCNN(FasterRCNN):
assert
metric
in
[
'COCO'
,
'VOC'
],
"Metric only support 'VOC' or 'COCO'"
self
.
metric
=
metric
if
not
self
.
trainable
:
raise
Exception
(
"Model is not trainable since it was loaded from a inference model."
)
raise
Exception
(
"Model is not trainable from load_model method."
)
self
.
labels
=
copy
.
deepcopy
(
train_dataset
.
labels
)
self
.
labels
.
insert
(
0
,
'background'
)
# 构建训练网络
...
...
paddlex/cv/models/yolo_v3.py
浏览文件 @
f02f0476
...
...
@@ -194,9 +194,7 @@ class YOLOv3(BaseAPI):
ValueError: 模型从inference model进行加载。
"""
if
not
self
.
trainable
:
raise
ValueError
(
"Model is not trainable since it was loaded from a inference model."
)
raise
ValueError
(
"Model is not trainable from load_model method."
)
if
metric
is
None
:
if
isinstance
(
train_dataset
,
paddlex
.
datasets
.
CocoDetection
):
metric
=
'COCO'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录