Given below is a simple example to train a Caffe model on the Iris data set in Python, using PyCaffe. It also gives the predicted outputs given some user-defined inputs.
iris_tuto.py
import subprocess
import platform
import copy
from sklearn.datasets import load_iris
import sklearn.metrics
...