A simple tool for monitoring caffe training process. Clone this repository into your public_html folder to be able to monitor your network optimisation from a web browser. Loss and accuracy charts are plotted automatically and updated at a chosen time interval.
- Redirect caffe output to a file:
caffe train -solver=solver.prototxt -weights=VGG_FACE.caffemodel -gpu=0 2>&1 | tee log.txt
- Make sure log.txt has reading permissions.
- In the caffe-monitoring directory, create a symbolic link to your log.txt file:
ln -s /path/to/log.txt log.txt
- When accessing your public_html page from a web browser, if log.txt is listed under caffe-monitoring directory, then you are good to go.
- Open caffe.html and type log.txt in the Filename input.
- Choose polling interval for chart updates (defaults to 60 seconds).
- Press start button.
If you would like to also plot test accuracies, you may want to write your own python layer for that. As the caffe-monitoring tool uses regular expressions to fetch data from caffe logs, some rules should be followed when printing your results.
- To plot individual accuracies for each class of your problem:
print "Test result: class = {0}, accuracy = {1}".format(class, '%.3f' % accuracy)
- To plot the mean accuracy:
print "Test result: mean, accuracy = {1}".format(class, '%.3f' % numpy.mean(accuracies))
- To print class labels instead of numbers:
print "Label for class {0} = {1}".format(class, class_label)
- Do not forget to force the buffer to stdout after the these printing:
sys.stdout.flush()
- In the Classes input, type the classes your would like to plot values to. The list must be comma-separated. Ex: 0,1,2.
- Press stop button.
- Press start button.