Skip to content

No operations detected in saved model when running Session.LoadFromSavedModel #47

Open
@ayadgithub

Description

@ayadgithub

Hello ,

I have trained a SSD MobileNet V2 FPNLite 640x640 pretrained model in Tensorflow 2.4 with my own data and exported as saved model .The inference and image object detection prediction is working perfectly fine in python .
Im trying to do the same in Tensorflow.Net using the below code :
Session session = Session.LoadFromSavedModel(@"........\saved_model");
Tensor tensorNum = graph.OperationByName("num_detections");
Tensor tensorBoxes = graph.OperationByName("detection_boxes");
Tensor tensorScores = graph.OperationByName("detection_scores");
Tensor tensorClasses = graph.OperationByName("detection_classes");
Tensor imgTensor = graph.OperationByName("image_tensor");
Tensor[] outTensorArr = new Tensor[] { tensorNum, tensorBoxes, tensorScores, tensorClasses };

Im getting below weird error:

Tensorflow.ValueError: 'Could not find operation "num_detections" inside graph "grap-key-1/".'

I tried to loop the graph operations of the session but there is nothing in there .

Why this is happening ,it is the same model Im using in python and giving correct results .

Appreciate any help

Regards
Ayad

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions