Unexpected error: <type 'exceptions.RuntimeError'>
Created by: QinZiwen
我模仿demo写了这样一个测试例子:
import random
from visualdl import LogWriter
logdir = "./random_log"
logw = LogWriter(logdir, sync_cycle=10)
with logw.mode('train') as logger:
train_loss_log = logger.scalar("train/loss")
train_correct_acc_log = logger.scalar("CorrectAccuracy")
train_mistake_acc_log = logger.scalar("MistakeAccuracy")
with logw.mode('valid') as logger:
valid_correct_acc_log = logger.scalar("CorrectAccuracy")
valid_mistake_acc_log = logger.scalar("MistakeAccuracy")
for step in range(200):
train_loss_log.add_record(step, 200./(step + 1))
train_correct_acc_log.add_record(step, step * 2.0)
train_mistake_acc_log.add_record(step, step * 3.0)
valid_correct_acc_log.add_record(step, step * 4.0)
valid_mistake_acc_log.add_record(step, step * 1.0)
当用浏览其可视化的时候,终端报错:
-
[WARNING 2018-01-19 13:13:25,795 lib.py:218] update cache /data/plugin/scalars/scalars/train/MistakeAccuracy
[INFO 2018-01-19 13:13:25,798 _internal.py:88] 127.0.0.1 - - [19/Jan/2018 13:13:25] "GET /data/plugin/scalars/scalars?run=train&tag=MistakeAccuracy HTTP/1.1" 200 -
[WARNING 2018-01-19 13:13:25,798 lib.py:218] update cache /data/plugin/scalars/scalars/valid/MistakeAccuracy
[libprotobuf FATAL /build/VisualDL/build/third_party/install/protobuf/include/google/protobuf/repeated_field.h:1431] CHECK failed: (index) < (current_size_):
[ERROR 2018-01-19 13:13:25,800 lib.py:211] Unexpected error: <type 'exceptions.RuntimeError'>
CHECK failed: (index) < (current_size_):
<traceback object at 0x7fb04e2b95f0>
[libprotobuf FATAL /build/VisualDL/build/third_party/install/protobuf/include/google/protobuf/repeated_field.h:1431] CHECK failed: (index) < (current_size_):
[ERROR 2018-01-19 13:13:27,803 lib.py:211] Unexpected error: <type 'exceptions.RuntimeError'>
CHECK failed: (index) < (current_size_):
<traceback object at 0x7fb04e2b9488>
[libprotobuf FATAL /build/VisualDL/build/third_party/install/protobuf/include/google/protobuf/repeated_field.h:1431] CHECK failed: (index) < (current_size_):
[ERROR 2018-01-19 13:13:29,810 lib.py:211] Unexpected error: <type 'exceptions.RuntimeError'>
CHECK failed: (index) < (current_size_):
<traceback object at 0x7fb04e2b94d0>
但是,只要我把‘CorrectAccuracy’ 或者 ‘MistakeAccuracy’ ,任意一个删除掉,就不报错,一起正常。难道是visualdl只支持两个scalar?