Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ayadgithub opened this issue Mar 26, 2021 · 1 comment

Comments

@ayadgithub
Copy link

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

@IamSierraCharlie
Copy link

did you fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants