Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yolov5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
yolov5
Commits
acff977a
Unverified
提交
acff977a
authored
10月 17, 2022
作者:
Glenn Jocher
提交者:
GitHub
10月 17, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Logger Cleanup (#9828)
上级
e3ff7806
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
2 行增加
和
16 行删除
+2
-16
train.py
segment/train.py
+0
-12
train.py
train.py
+1
-3
general.py
utils/general.py
+1
-1
没有找到文件。
segment/train.py
浏览文件 @
acff977a
...
...
@@ -91,17 +91,6 @@ def train(hyp, opt, device, callbacks): # hyp is path/to/hyp.yaml or hyp dictio
data_dict
=
None
if
RANK
in
{
-
1
,
0
}:
logger
=
GenericLogger
(
opt
=
opt
,
console_logger
=
LOGGER
)
# loggers = Loggers(save_dir, weights, opt, hyp, LOGGER) # loggers instance
# if loggers.clearml:
# data_dict = loggers.clearml.data_dict # None if no ClearML dataset or filled in by ClearML
# if loggers.wandb:
# data_dict = loggers.wandb.data_dict
# if resume:
# weights, epochs, hyp, batch_size = opt.weights, opt.epochs, opt.hyp, opt.batch_size
#
# # Register actions
# for k in methods(loggers):
# callbacks.register_action(k, callback=getattr(loggers, k))
# Config
plots
=
not
evolve
and
not
opt
.
noplots
# create plots
...
...
@@ -400,7 +389,6 @@ def train(hyp, opt, device, callbacks): # hyp is path/to/hyp.yaml or hyp dictio
'ema'
:
deepcopy
(
ema
.
ema
)
.
half
(),
'updates'
:
ema
.
updates
,
'optimizer'
:
optimizer
.
state_dict
(),
# 'wandb_id': loggers.wandb.wandb_run.id if loggers.wandb else None,
'opt'
:
vars
(
opt
),
'date'
:
datetime
.
now
()
.
isoformat
()}
...
...
train.py
浏览文件 @
acff977a
...
...
@@ -53,7 +53,6 @@ from utils.general import (LOGGER, check_amp, check_dataset, check_file, check_g
one_cycle
,
print_args
,
print_mutation
,
strip_optimizer
,
yaml_save
)
from
utils.loggers
import
Loggers
from
utils.loggers.comet.comet_utils
import
check_comet_resume
from
utils.loggers.wandb.wandb_utils
import
check_wandb_resume
from
utils.loss
import
ComputeLoss
from
utils.metrics
import
fitness
from
utils.plots
import
plot_evolve
...
...
@@ -375,7 +374,6 @@ def train(hyp, opt, device, callbacks): # hyp is path/to/hyp.yaml or hyp dictio
'ema'
:
deepcopy
(
ema
.
ema
)
.
half
(),
'updates'
:
ema
.
updates
,
'optimizer'
:
optimizer
.
state_dict
(),
'wandb_id'
:
loggers
.
wandb
.
wandb_run
.
id
if
loggers
.
wandb
else
None
,
'opt'
:
vars
(
opt
),
'date'
:
datetime
.
now
()
.
isoformat
()}
...
...
@@ -483,7 +481,7 @@ def main(opt, callbacks=Callbacks()):
check_requirements
()
# Resume (from specified or most recent last.pt)
if
opt
.
resume
and
not
check_
wandb_resume
(
opt
)
and
not
check_
comet_resume
(
opt
)
and
not
opt
.
evolve
:
if
opt
.
resume
and
not
check_comet_resume
(
opt
)
and
not
opt
.
evolve
:
last
=
Path
(
check_file
(
opt
.
resume
)
if
isinstance
(
opt
.
resume
,
str
)
else
get_latest_run
())
opt_yaml
=
last
.
parent
.
parent
/
'opt.yaml'
# train options yaml
opt_data
=
opt
.
data
# original dataset
...
...
utils/general.py
浏览文件 @
acff977a
...
...
@@ -956,7 +956,7 @@ def strip_optimizer(f='best.pt', s=''): # from utils.general import *; strip_op
x
=
torch
.
load
(
f
,
map_location
=
torch
.
device
(
'cpu'
))
if
x
.
get
(
'ema'
):
x
[
'model'
]
=
x
[
'ema'
]
# replace model with ema
for
k
in
'optimizer'
,
'best_fitness'
,
'
wandb_id'
,
'
ema'
,
'updates'
:
# keys
for
k
in
'optimizer'
,
'best_fitness'
,
'ema'
,
'updates'
:
# keys
x
[
k
]
=
None
x
[
'epoch'
]
=
-
1
x
[
'model'
]
.
half
()
# to FP16
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论