Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yolov5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
yolov5
Commits
070af881
Unverified
提交
070af881
authored
10月 05, 2021
作者:
Glenn Jocher
提交者:
GitHub
10月 05, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix `yaml.safe_load()` ignore emoji errors (#5060)
上级
5afc9c25
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
5 行增加
和
5 行删除
+5
-5
yolo.py
models/yolo.py
+1
-1
train.py
train.py
+3
-3
resume.py
utils/aws/resume.py
+1
-1
没有找到文件。
models/yolo.py
浏览文件 @
070af881
...
...
@@ -87,7 +87,7 @@ class Model(nn.Module):
else
:
# is *.yaml
import
yaml
# for torch hub
self
.
yaml_file
=
Path
(
cfg
)
.
name
with
open
(
cfg
)
as
f
:
with
open
(
cfg
,
errors
=
'ignore'
)
as
f
:
self
.
yaml
=
yaml
.
safe_load
(
f
)
# model dict
# Define model
...
...
train.py
浏览文件 @
070af881
...
...
@@ -72,7 +72,7 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
# Hyperparameters
if
isinstance
(
hyp
,
str
):
with
open
(
hyp
)
as
f
:
with
open
(
hyp
,
errors
=
'ignore'
)
as
f
:
hyp
=
yaml
.
safe_load
(
f
)
# load hyps dict
LOGGER
.
info
(
colorstr
(
'hyperparameters: '
)
+
', '
.
join
(
f
'{k}={v}'
for
k
,
v
in
hyp
.
items
()))
...
...
@@ -488,7 +488,7 @@ def main(opt, callbacks=Callbacks()):
if
opt
.
resume
and
not
check_wandb_resume
(
opt
)
and
not
opt
.
evolve
:
# resume an interrupted run
ckpt
=
opt
.
resume
if
isinstance
(
opt
.
resume
,
str
)
else
get_latest_run
()
# specified or most recent path
assert
os
.
path
.
isfile
(
ckpt
),
'ERROR: --resume checkpoint does not exist'
with
open
(
Path
(
ckpt
)
.
parent
.
parent
/
'opt.yaml'
)
as
f
:
with
open
(
Path
(
ckpt
)
.
parent
.
parent
/
'opt.yaml'
,
errors
=
'ignore'
)
as
f
:
opt
=
argparse
.
Namespace
(
**
yaml
.
safe_load
(
f
))
# replace
opt
.
cfg
,
opt
.
weights
,
opt
.
resume
=
''
,
ckpt
,
True
# reinstate
LOGGER
.
info
(
f
'Resuming training from {ckpt}'
)
...
...
@@ -552,7 +552,7 @@ def main(opt, callbacks=Callbacks()):
'mixup'
:
(
1
,
0.0
,
1.0
),
# image mixup (probability)
'copy_paste'
:
(
1
,
0.0
,
1.0
)}
# segment copy-paste (probability)
with
open
(
opt
.
hyp
)
as
f
:
with
open
(
opt
.
hyp
,
errors
=
'ignore'
)
as
f
:
hyp
=
yaml
.
safe_load
(
f
)
# load hyps dict
if
'anchors'
not
in
hyp
:
# anchors commented in hyp.yaml
hyp
[
'anchors'
]
=
3
...
...
utils/aws/resume.py
浏览文件 @
070af881
...
...
@@ -21,7 +21,7 @@ for last in path.rglob('*/**/last.pt'):
continue
# Load opt.yaml
with
open
(
last
.
parent
.
parent
/
'opt.yaml'
)
as
f
:
with
open
(
last
.
parent
.
parent
/
'opt.yaml'
,
errors
=
'ignore'
)
as
f
:
opt
=
yaml
.
safe_load
(
f
)
# Get device count
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论