machinelearning: Unable to find input colum on tensor flow model using C#
System information
- OS version/distro: Windows 10
- .NET Version (eg., dotnet --info): .NET Core 3.0
Issue
- What did you do? I created my own TensorFlow object detection model and tried to load it in a C# console application.
- What happened? When I tried to create a model by using pipeline.fit I get this error System.ArgumentOutOfRangeException: ”Could not find input column ‘image_tensor’ (Parameter ‘inputSchema’)
- What did you expect? I would have been able to create the model and continue to create the prediction engine and test my TensorFlow.
Source code / logs
I posted the question on the blog that showed how to load a pretrained TensorFlow model to “Call out @yaeldekel in the issue. She might be able to help here.”
Here is what I see in Netron

Here is how I am loading the pipeline
var pipeline = context.Transforms
.LoadImages("input", @"D:\tensorflow1\images",nameof(ImageNetData.ImagePath))
.Append(context.Transforms.ExtractPixels(outputColumnName: "input", interleavePixelColors: true))
.Append(context.Model.LoadTensorFlowModel(@"D:\tensorflow1\models\research\object_detection\inference_graph\PotatoDetector.pb")
.ScoreTensorFlowModel(outputColumnNames: new[] { "detection_boxes","detection_classes","detection_scores", "num_detections" } },inputColumnNames: new[] { "image_tensor" }, addBatchDimensionInput: true));
When I try to load the model inPython like so it works just fine.
image_tensor = detection_graph.get_tensor_by_name('image_tensor:0')
detection_boxes = detection_graph.get_tensor_by_name('detection_boxes:0')
detection_scores = detection_graph.get_tensor_by_name('detection_scores:0')
detection_classes = detection_graph.get_tensor_by_name('detection_classes:0')
num_detections = detection_graph.get_tensor_by_name('num_detections:0')
image = cv2.imread(PATH_TO_IMAGE)
image_expanded = np.expand_dims(image, axis=0)
print("going to run the model now")
(boxes, scores, classes, num) = sess.run(
[detection_boxes, detection_scores, detection_classes, num_detections],
feed_dict={image_tensor: image_expanded})
Any ideas on how to find the input column that ML.NET wants?
Please paste or attach the code or logs or traces that would be helpful to diagnose the issue you are reporting.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (9 by maintainers)
Hi, Will this issue be befixed with next release? We also have the same problem when we try to use Tensorflow model.
We have been using CNTK for object detection, but we urgently need alternative to this. We now trained our data with Tensorflow but we are stuck with using it in ML.NET. Tried to use different models, but issue is the same. Thanks.