plotflush doesn't close file
egaebel opened this issue · comments
I'm using gnuplot to visualize response filters from convolutional nets, and I decided as a first pass to visualize ALL of the response filters, which adds up pretty quickly.
I was using this code for the gnuplot operations:
gnuplot.pngfigure(filePath)
gnuplot.imagesc(v.output[1][i])
gnuplot.plotflush()
v.output[1][i] is the output from each layer.
So I was running this code and I was hitting the limit in Linux on the number of open files. I ran it again and tracked the number of open files, it hit about 700,000.... (I had increased the open file limit).
So I did some reading, and decided to try running it with the addition of gnuplot.close() at the end.
That solved everything.
I'm not sure if this is expected behavior or not, but from the tutorial (linked below) it seemed to me like gnuplot.plotflush() should take care of everything.
https://github.com/torch/gnuplot/blob/f74e8c1dad1326d72878692fd8a25d2a5bb2740d/doc/file.md