Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
VisualDL
提交
13fae54d
V
VisualDL
项目概览
PaddlePaddle
/
VisualDL
1 年多 前同步成功
通知
88
Star
4655
Fork
642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
5
Wiki
分析
仓库
DevOps
项目成员
Pages
V
VisualDL
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
5
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
13fae54d
编写于
12月 28, 2020
作者:
走神的阿圆
提交者:
GitHub
12月 28, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add doc for LogReader in README.md (#892)
* add doc for LogReader in README.md * fix review
上级
2bb4183e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
38 addition
and
8 deletion
+38
-8
README.md
README.md
+32
-0
README_CN.md
README_CN.md
+6
-8
未找到文件。
README.md
浏览文件 @
13fae54d
...
...
@@ -221,6 +221,38 @@ After launching the panel by one of the above methods, developers can see the vi
<img
src=
"https://user-images.githubusercontent.com/48054808/90868674-ba321f00-e3c9-11ea-83c1-f03c6dd19187.png"
width=
"70%"
/>
</p>
### 3. Read data in log files using LogReader
VisualDL also provides
`LogReader`
interface to read raw data from log files.
```
python
class
LogReader
(
file_path
=
''
)
```
#### interface parameters
| parameters | type | meaning |
| ---------- | ------ | ------------------------------------ |
| file_path | string | File path of the log file. Required. |
#### Example
If there is a log file named
`vdlrecords.1605533348.log`
in the directory of
`./log`
, we can retrieve the data under the 'loss' tag in the scalar by:
```
python
from
visualdl
import
LogReader
reader
=
LogReader
(
file_path
=
'./vdlrecords.1605533348.log'
)
data
=
reader
.
get_data
(
'scalar'
,
'loss'
)
print
(
data
)
```
The result will be a list shown as below:
```
python
...
id
:
5
tag
:
"Metrics/Training(Step): loss"
timestamp
:
1605533356039
value
:
3.1297709941864014
...
```
For more information of
`LogReader`
, please refer to
[
LogReader
](
./docs/io/LogReader.md
)
.
## Function Preview
### Scalar
...
...
README_CN.md
浏览文件 @
13fae54d
...
...
@@ -230,25 +230,23 @@ app.run(logdir="./log")
VisualDL的后端也提供了获取日志数据的组件
`LogReader`
,可通过其获取日志中任意数据,接口如下:
```
python
class
LogReader
(
logdir
=
None
,
file_name
=
''
)
class
LogReader
(
file_path
=
''
)
```
#### 接口参数
| 参数 | 格式 | 含义 |
| --------- | ------ | -------------------------- |
| logdir | string | 日志文件所在的路径,必填 |
| file_name | string | 指定要读的日志文件名,必填 |
| 参数 | 格式 | 含义 |
| --------------- | ------- | ------------------------------------------------------------ |
| file_path | string | 指定要读的日志文件路径,必填,注意这里与file_name不同,需填写具体路径|
#### 示例
假定在
`./log`
文件夹下有一个日志文件
`vdlrecords.1605533348.log`
,则获取
此日志中tag为
`loss`
的scalar数据过程
如下:
假定在
`./log`
文件夹下有一个日志文件
`vdlrecords.1605533348.log`
,则获取
LogReader实例
如下:
```
python
from
visualdl
import
LogReader
reader
=
LogReader
(
logdir
=
'./log'
,
file_name
=
'
vdlrecords.1605533348.log'
)
reader
=
LogReader
(
file_path
=
'./log/
vdlrecords.1605533348.log'
)
data
=
reader
.
get_data
(
'scalar'
,
'loss'
)
print
(
data
)
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录