Open leezu opened 6 years ago
should flush happen first?
@szha is right. You need to flush()
before close()
. In fact, you don't need to flush explicitly as close()
would call flush()
first before actually closing the file handle. The following code works for me.
from mxboard import SummaryWriter
sw = SummaryWriter('./logs')
sw.add_text('test', 'test', 0)
sw.add_text('test', 'test', 1)
sw.close()
Should sw give a warning about flushing to a closed writer?
A second thought came to me that even close()
happened before flush()
, the result should have been recorded anyway when close()
is called. There shouldn't be empty results on the GUI. I tried the code provided by @leezu and I can see the text logged correctly. Could you please confirm again?
The flush in the above code shouldn't have any effect. There is no real reason for it being included above, sorry for the noise.
I still don't get any output in tensorboard, but then it may be related to my version of tensorboard given that it works for you. @reminisce could you upload the event file that you get when running the code?
Also getting the same issue here @reminisce with the following pip installed packages:
Name: mxnet
Version: 1.2.0
Name: mxboard
Version: 0.1.0
Name: tensorflow
Version: 1.8.0
Name: tensorboard
Version: 1.9.0
Seems to be an issue with TensorBoard/Tensorflow v1.7 onwards. I don't have an issue with text rendering for TB/TF v1.6.
i meet the same problem, which version of tensorflow and tensorboard can work
pip install tensorflow==1.6.0
solves it.
it seems that this issue did not fixed yet. add_text and add_pr_curve in my project did not work correctly.
code like this: ` sw = SummaryWriter(logdir='./logs',max_queue=10,flush_secs=5) img = cv2.imread('test.jpg').transpose((2,0,1)) img = np.expand_dims(img,axis=0) sw.add_scalar(tag='gg',value=10,global_step=1) sw.add_image(tag='img',image=img,global_step=0) sw.add_pr_curve('xoxo', np.random.uniform(0,1,100), np.random.uniform(0,1,100),200, 0) sw.add_text(tag='tttt',text='xxxxxdddd',global_step=3)
sw.flush()
sw.close()
`
creates the following event file
But tensorboard doesn't show any output