My approach is less than ideal but it works. Go into your
Edit: {caffe_root}/python/caffe/init.py file and add these two{caffe_root}/python/caffe/__init__.py
Add the following lines to the top:
import matplotlib matplotlib.use('Agg')
import matplotlib matplotlib.use('Agg')