I am working on Caffe framework and using PyCaffe interface. I am using a Python script obtained from converting the IPython Notebook 00-classification.ipynb
If your intention is to run converted .py file notebook then you should just comment out get_ipython() statements. The matlibplot output can't be shown inside console so you would have some work to do . Ideally, iPython shouldn't have generated these statements. You can use following to show plots:
plt.show(block=True)