Using a tensorflow model

Good Day.

I have a scene where I’m able to draw using a Line tracer and using the camera I’m able to take a screenshot of said drawn scene.

I’m trying to connect a simple model of a trained CNN on the MNIST dataset the thing is I’m trying to use TensorflowSharp as it’s detailed in this README.

But I’m having problems just trying to process the information

graph = new TFGraph();
graph.Import(graphModel.bytes);
session = new TFSession(graph);
var runner = session.GetRunner();

runner.AddInput(graph[“input”][0], image);

But it says that graph is not an instance of an object.

How can I access the model ?

I’m about to tackle a really similar problem - did you ever get this figured out? Any good resources to point to?

Follow this code may be help…

private TextAsset graphModel;
graphModel = Resources.Load(graph_path) as TextAsset;

I think you may forgot the code to import the actual model in it.

PS graph path rooted in Resources Folder so make sure that the graphmodel is in Resources folder in my case graph path is (public string graph_path= “TFModels/graph”:wink: like this.

In case you’d like a working example project to start from, you can check this one out. It’s a very simple example project that includes a TensorFlow model, trained graph, and working classifier.