Contents
This topic describes how to run the sample application for the Spotfire Streaming Operator For TensorFlow Model Evaluator, and illustrates how to use the TensorFlow adapter to feed in data, compute the TensorFlow model, and output the desired results.
The tensorflow.sbapp
sample demonstrates a simple
process of multiplying an input value by 2 and 3 with the provided model example.
The other sample, imageClassification.sbapp
,
demonstrates a complete process of image processing with TensorFlow. The input will
be an image, and the output will showing the highest probabilities of the image file.
In StreamBase Studio, import this sample with the following steps:
-
From the top-level menu, select
> . -
Enter
tensor
to narrow the list of options. -
Select TensorFlow from the StreamBase Standard Adapters category.
-
Click
.
StreamBase Studio creates a single project for the TensorFlow adapter samples in your current Studio workspace.
Run this sample in Studio as follows:
-
In the Project Explorer view, open the sample you just loaded.
If you see red marks on a project folder, wait a moment for the project to load its features.
If the red marks do not resolve themselves after a minute, select the project, right-click, and select
> from the context menu. -
Open the
src/main/eventflow/
folder.packageName
-
Double-click to open the
tensorflow.sbapp
application, then click the Run button. This opens the SB Test/Debug perspective and starts the application. -
In the Manual Input view, select the Input input stream.
-
Enter
float
in the dataType field, and one double-type value in the value field. Leave the shape field blank. -
Click
. -
Observe your message emitted in the Output Streams view.
-
When done, press F9 or click the Stop Running Application button.
Run this sample in Studio as follows:
-
In the Project Explorer view, open the sample you just loaded.
If you see red marks on a project folder, wait a moment for the project to load its features.
If the red marks do not resolve themselves after a minute, select the project, right-click, and select
> from the context menu. -
Download the needed model for image classification model: Go to
http://public.tibco.com/pub/tibco_oss/streaming-tensorflow-sample/graph.pb
, download this graph.pb file. Copy to your sample'simageClassification
folder in thesrc/main/resources
folder. -
Open the
src/main/eventflow/
folder.packageName
-
Double-click to open the
imageClassification.sbapp
application, then click the Run button. This opens the SB Test/Debug perspective and starts the application. -
Observe your message emitted in the Output Streams view.
-
In the Manual Input view, select the ImageFile input stream; try with input image path, for example:
imageClassification/porcupine.jpg
. -
When done, press F9 or click the Stop Running Application button.
When you load the sample into StreamBase® Studio, Studio copies the sample project's files to your Studio workspace, which is normally part of your home directory, with full access rights.
Important
Load this sample in StreamBase® Studio, and thereafter use the Studio workspace copy of the sample to run and test it, even when running from the command prompt.
Using the workspace copy of the sample avoids permission problems. The default workspace location for this sample is:
studio-workspace
/sample_adapter_embedded_tensorflow
See Default Installation
Directories for the default location of studio-workspace
on your system.