未验证 提交 d59c2993 编写于 作者: W wangguanzhong 提交者: GitHub

add python version check for visualdl (#952)

上级 5e24bda3
......@@ -41,8 +41,8 @@ list below can be viewed by `--help`
| --draw_threshold | infer | Threshold to reserve the result for visualization | 0.5 | `--draw_threshold 0.7` |
| --infer_dir | infer | Directory for images to perform inference on | None | |
| --infer_img | infer | Image path | None | higher priority over --infer_dir |
| --use_vdl | train/infer | Whether to record the data with [VisualDL](https://github.com/paddlepaddle/visualdl), so as to display in VisualDL | False | |
| --vdl\_log_dir | train/infer | VisualDL logging directory for image | train:`vdl_log_dir/scalar` infer: `vdl_log_dir/image` | |
| --use_vdl | train/infer | Whether to record the data with [VisualDL](https://github.com/paddlepaddle/visualdl), so as to display in VisualDL | False | VisualDL requires Python>=3.5 |
| --vdl\_log_dir | train/infer | VisualDL logging directory for image | train:`vdl_log_dir/scalar` infer: `vdl_log_dir/image` | VisualDL requires Python>=3.5 |
## Examples
......
......@@ -38,8 +38,8 @@ python tools/infer.py -c configs/faster_rcnn_r50_1x.yml --infer_img=demo/0000005
| --draw_threshold | infer | 可视化时分数阈值 | 0.5 | `--draw_threshold 0.7` |
| --infer_dir | infer | 用于预测的图片文件夹路径 | None | |
| --infer_img | infer | 用于预测的图片路径 | None | 相较于`--infer_dir`具有更高优先级 |
| --use_vdl | train/infer | 是否使用[VisualDL](https://github.com/paddlepaddle/visualdl)记录数据,进而在VisualDL面板中显示 | False | |
| --vdl\_log_dir | train/infer | 指定 VisualDL 记录数据的存储路径 | train:`vdl_log_dir/scalar` infer: `vdl_log_dir/image` | |
| --use_vdl | train/infer | 是否使用[VisualDL](https://github.com/paddlepaddle/visualdl)记录数据,进而在VisualDL面板中显示 | False | VisualDL需Python>=3.5 |
| --vdl\_log_dir | train/infer | 指定 VisualDL 记录数据的存储路径 | train:`vdl_log_dir/scalar` infer: `vdl_log_dir/image` | VisualDL需Python>=3.5 |
## 使用示例
......
......@@ -24,6 +24,7 @@ if parent_path not in sys.path:
import glob
import numpy as np
import six
from PIL import Image
from paddle import fluid
......@@ -160,6 +161,7 @@ def main():
# use VisualDL to log image
if FLAGS.use_vdl:
assert six.PY3, "VisualDL requires Python >= 3.5"
from visualdl import LogWriter
vdl_writer = LogWriter(FLAGS.vdl_log_dir)
vdl_image_step = 0
......
......@@ -26,6 +26,7 @@ import time
import numpy as np
import random
import datetime
import six
from collections import deque
from paddle.fluid import profiler
......@@ -224,6 +225,7 @@ def main():
# use VisualDL to log data
if FLAGS.use_vdl:
assert six.PY3, "VisualDL requires Python >= 3.5"
from visualdl import LogWriter
vdl_writer = LogWriter(FLAGS.vdl_log_dir)
vdl_loss_step = 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册