-
Notifications
You must be signed in to change notification settings - Fork 865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
writer is never closed #108
Comments
@loic001 It is being flushed every time something is being written though: |
Yes but...
It depends on the limit of the maximum number of opened files on the linux system but there shouldn't be this error anyway. That's why I said you should close it when SummaryWriter is closed. |
* Make sure calling .close() on SummaryWriter also closes the event file. * Fixes lanpa#108 Signed-off-by: mr.Shu <[email protected]>
@loic001 Ah, you are indeed right. I've proposed a fix that should deal with this. |
the test fails on mac. |
@lanpa interesting. Does it fail with Thanks! |
@mrshu It's |
@lanpa Thanks. Looking at this (http://python.6.x6.nabble.com/maximum-number-of-threads-td1124579.html) it seems that the number is very much dependent on the memory address space of the box you run the test on. In other words, it is not related to the In other words, I'd say that the test is working, but using such a high number does not make too much sense. Using something like a 100 would probably be sufficient. |
@lanpa def test_summary_writer_close():
# Opening and closing SummaryWriter a lot should not run into
# OSError: [Errno 24] Too many open files
passed = True
try:
for i in range(10):
writer = SummaryWriter()
writer.file_writer.flush()
writer.file_writer.close()
writer._record_writer
del writer
gc.collect()
except OSError:
passed = False
assert passed
test_summary_writer_close() lsof | grep ' yourusername ' | awk '{print $NF}' | sort | wc -l the .close() method has no effect. |
I also find myself in a situation where I need to have many summary writers and hence run into What about adding a flag Ideally |
Any updates on this? |
An additional problem is that the |
Would love to have a fix for this issue ! Can we get #498 accepted now that it passes tests ? |
Hi,
https://github.com/lanpa/tensorboard-pytorch/blob/master/tensorboardX/record_writer.py
self._writer = open(path, 'wb')
is never closedThe text was updated successfully, but these errors were encountered: