Modeling Guide

Create a Graph to Execute a TensorFlow Application

The SAP Data Hub Modeler provides a dockerized execution environment for TensorFlow (TF) programs with Python 2.7 and TensorFlow 1.7.0.

Context

This tutorial explains how to use the SAP Data Hub Modeler to execute a TensorFlow Python application.

Procedure

  1. Start the SAP Data Hub Modeler.
  2. In the navigation pane, choose the Repository tab.
    The tool displays all graphs, operators, and Dockerfiles available in your repository and is grouped under the tabs, Graphs, Operators, Docker Files respectively.
  3. Create an operator.
    If you want to execute a TensorFlow application using the modeler, first create an operator that includes the TensorFlow application code.
    1. Right-click the Operators section and choose Create Folder to create a new folder in which you want to define the operator.
    2. Right-click the folder in which you want to create the operator and choose the Create Operator menu option.
    3. In the Name text field, provide a name as the identifier name for the operator as trainOP.
    4. In Display Name text field, a display name for the operator as Train MNIST.
      You can use the display name to search and add the operator when creating graphs.
    5. In the Base Operator dropdown list, select Python2Operator.
      The operator that you create is derived from the base operators that SAP Data Hub provides.
    6. Choose OK.
      The tool opens an operator editor window. The operator editor is a form-based editor, where you can define the operator.
  4. Define the operator.
    Use the operator editor view to define your operator.
    1. In the Tags section, choose the + (Add tag) icon.
      Tags describe the runtime requirements of operators and are the annotations of Dockerfiles that the tool provides.
    2. In the dropdown list, select the python27 tag and choose no version.
    3. In the Tags section, choose the + (Add tag) icon to create an additional tag.
    4. In the dropdown list, select the tensorflow tag and choose the version 1.7.0.
    5. Define input and output ports of the type. For example, message.python.image for incoming images and string for the output result.
    6. In the inline editor add the tensorflow application code.
  5. Save the operator.
    1. In the editor toolbar, choose (Save) to save the operator.
      You can now use the TensorFlow training operator in a graph.
  6. Create a graph with TensorFlow operator.
    After creating a TensorFlow operator, t, you can use the operator in a graph.
    1. Switch to the Graphs tab.
    2. In the navigation pane toolbar, choose + (Create Graph).
      The tool opens an empty graph editor in the same window, where you can define your graph.
    3. In the navigation pane, choose the Operators tab.
    4. In the list of operators, select the Train MNIST operator that you created.
      Your graph now consists of only one operator, which contains the TensorFlow application.
  7. Save the graph.
    1. After creating a graph, in the editor toolbar, choose (Save) to save your graph.
    2. Choose the Save menu option.
    3. Provide a name along with the fully qualified path to the graph.
      For example, com.orgname.others.graphname.
    4. Provide a description to the graph.
    5. Choose OK.
  8. Execute the graph.
    1. In the editor toolbar, choose (Run).
    2. Select the Run menu option to execute the graph.