Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yolov5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
yolov5
Commits
c923fbff
Unverified
提交
c923fbff
authored
12月 17, 2020
作者:
Glenn Jocher
提交者:
GitHub
12月 17, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
W&B artifacts feature addition (#1712)
* Log artifacts * cleanup
上级
1fc9d42a
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
5 行删除
+10
-5
train.py
train.py
+10
-5
没有找到文件。
train.py
浏览文件 @
c923fbff
...
...
@@ -386,10 +386,12 @@ def train(hyp, opt, device, tb_writer=None, wandb=None):
if
rank
in
[
-
1
,
0
]:
# Strip optimizers
final
=
best
if
best
.
exists
()
else
last
# final model
for
f
in
[
last
,
best
]:
if
f
.
exists
():
# is *.pt
strip_optimizer
(
f
)
# strip optimizer
os
.
system
(
'gsutil cp
%
s gs://
%
s/weights'
%
(
f
,
opt
.
bucket
))
if
opt
.
bucket
else
None
# upload
if
f
.
exists
():
strip_optimizer
(
f
)
# strip optimizers
if
opt
.
bucket
:
os
.
system
(
f
'gsutil cp {final} gs://{opt.bucket}/weights'
)
# upload
# Plots
if
plots
:
...
...
@@ -398,9 +400,11 @@ def train(hyp, opt, device, tb_writer=None, wandb=None):
files
=
[
'results.png'
,
'precision_recall_curve.png'
,
'confusion_matrix.png'
]
wandb
.
log
({
"Results"
:
[
wandb
.
Image
(
str
(
save_dir
/
f
),
caption
=
f
)
for
f
in
files
if
(
save_dir
/
f
)
.
exists
()]})
logger
.
info
(
'
%
g epochs completed in
%.3
f hours.
\n
'
%
(
epoch
-
start_epoch
+
1
,
(
time
.
time
()
-
t0
)
/
3600
))
if
opt
.
log_artifacts
:
wandb
.
log_artifact
(
artifact_or_path
=
str
(
final
),
type
=
'model'
,
name
=
save_dir
.
stem
)
# Test best.pt
logger
.
info
(
'
%
g epochs completed in
%.3
f hours.
\n
'
%
(
epoch
-
start_epoch
+
1
,
(
time
.
time
()
-
t0
)
/
3600
))
if
opt
.
data
.
endswith
(
'coco.yaml'
)
and
nc
==
80
:
# if COCO
for
conf
,
iou
,
save_json
in
([
0.25
,
0.45
,
False
],
[
0.001
,
0.65
,
True
]):
# speed, mAP tests
results
,
_
,
_
=
test
.
test
(
opt
.
data
,
...
...
@@ -408,7 +412,7 @@ def train(hyp, opt, device, tb_writer=None, wandb=None):
imgsz
=
imgsz_test
,
conf_thres
=
conf
,
iou_thres
=
iou
,
model
=
attempt_load
(
best
if
best
.
exists
()
else
last
,
device
)
.
half
(),
model
=
attempt_load
(
final
,
device
)
.
half
(),
single_cls
=
opt
.
single_cls
,
dataloader
=
testloader
,
save_dir
=
save_dir
,
...
...
@@ -448,6 +452,7 @@ if __name__ == '__main__':
parser
.
add_argument
(
'--sync-bn'
,
action
=
'store_true'
,
help
=
'use SyncBatchNorm, only available in DDP mode'
)
parser
.
add_argument
(
'--local_rank'
,
type
=
int
,
default
=-
1
,
help
=
'DDP parameter, do not modify'
)
parser
.
add_argument
(
'--log-imgs'
,
type
=
int
,
default
=
16
,
help
=
'number of images for W&B logging, max 100'
)
parser
.
add_argument
(
'--log-artifacts'
,
action
=
'store_true'
,
help
=
'log artifacts, i.e. final trained model'
)
parser
.
add_argument
(
'--workers'
,
type
=
int
,
default
=
8
,
help
=
'maximum number of dataloader workers'
)
parser
.
add_argument
(
'--project'
,
default
=
'runs/train'
,
help
=
'save to project/name'
)
parser
.
add_argument
(
'--name'
,
default
=
'exp'
,
help
=
'save to project/name'
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论