Skip to content

Visual Backprop for TensorFlow

This topic shows you how to generate a Visual Backprop for TensorFlow.

The steps that are covered are:

  • Installing OpenCV-Python
  • Generating a Visual Backprop for TensorFlow


Ensure that you have:

Installing OpenCV-Python

  • Option 1: Installing OpenCV-Python with pip

    If you have set up the system as the documentation has detailed here, you can simply run the command below. Otherwise, go to Option 2.

    pip install opencv-python
  • Option 2: Installing OpenCV-Python based on your environment

    • Install OpenCV-Python on Windows.

    • Install OpenCV-Python on MacOS.

Write code

Generate Visual Backprop with an image by adding the following code fragment at the end:


path = [URI]

with missinglink_project.create_experiment() as experiment:

    experiment.visual_back_prop(path, session)

Parameter descriptions

  • path: URI of an image. This is the original image.


    MissingLink understands that data can be proprietary and has an option for images to be private to only you when you provide MissingLink with a private URL.

    For URL, for example:, MissingLink will not download the image or store it on MissingLink servers. You need to ensure that the URL you have provided is private and can be accessed only from your machine or office.

    For a local file starting with "file://" or just a pure path such as "/home/user/image.jpg", MissingLink will download the file and serve it from MissingLink servers.

  • model: The model in order to run prediction.

  • input_val (options): Image preprocessed the same way as it would be used to feed to the network. If this is None, MissingLink assumes no preprocessing is needed and just loads an image.
  • dim_order (options): Dimensions order of the image. Can be one of "nhwc" -- for channel last ordering and "nchw" for channel first ordering. "nchw" is the default.
  • description (options): A string to display on the console that describes this data point. Can be the image id or any text.

You can find the full updated script here that MissingLink has provided using a pre-trained model known as VGG as an example.

You are done generating a Visual Backprop for TensorFlow. Now run the script and check the model on the MissingLink dashboard.