Skip to content

Integration with PyCaffe (Using Step)

This topic shows you how to integrate the MissingLink SDK with a PyCaffe LeNet network that is trained on the MNIST dataset.

The following steps are covered:

  • Define a project callback with your credentials.
  • Create a new experiment.
  • Give the experiment a name and description.
  • Use MissingLink's PyCaffeCallback to create a wrapped SGDSolver.


You can also consider trying the step-by-step tutorial for integrating the MissingLink SDK with an existing PyCaffe example.


  • You must have Caffe installed in the same working environment that MissingLink SDK is installed. The SDK doesn't enforce Caffe as one of its dependencies.

  • You must have created a new project. If not, follow the instructions in Creating a project.


Ensure that you can successfully run the basic training script. In the steps that follow below, the basic script is integrated with the MissingLink SDK to enable remote monitoring of the training,validation, and testing process.

Compare the basic script with the integrated script.

Write code

  1. Import the SDK and define your credentials at the beginning of the file (before any function definition).

    import missinglink
  2. Create a PyCaffeCallback instance with your credentials. This helps to monitor the experiment in real time. Add the following statement before creating a solver:

    missinglink_callback = missinglink.PyCaffeCallback()
  3. (Optional) Give the experiment a name and description by adding the following statement right after creating the MissingLink's PyCaffeCallback.

        display_name='MNIST', description='LeNet network')
  4. Next, instead of creating an original caffe solver, use the callback to create a wrapped solver. Modify the original solver creation statement with this statement:

    solver = missinglink_callback.create_wrapped_solver(
        caffe.SGDSolver, 'mnist/lenet_auto_solver.prototxt')

    You can find the full, updated script here.

  5. Use the created solver to step through the required number of iterations.

    solver = missinglink_callback.create_wrapped_solver(
        caffe.SGDSolver, 'mnist/lenet_auto_solver.prototxt')
    ITERATIONS = 1000
    for i in range(ITERATIONS):


  1. The SDK automatically collects the validation metrics on each test interval.

    To track validation metrics, use the test_interval configuration.

  2. If you are using custom metrics, there are additional steps that you need to perform.

    For more information, see Visualization of Custom Metrics in PyCaffe Frameworks.

You should have integrated MissingLink's SDK successfully.

  • Inspect the resulting integrated script.
  • Run the new script and see how the MissingLink dashboard helps with monitoring the experiment. A description follows.

Web dashboard monitoring

You can monitor your experiment on your MissingLink dashboard.

monitor your PyCaffe experiment on your MissingLink dashboard

Click on the experiment to view your metric graphs.

Click on the PyCaffe experiment to view your metric graphs

Next steps

Learn more about integrating with PyCaffe to enable the following MissingLink features: