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

'NotFoundIteration' Error when Calling DetectImage() for Object detection 'CustomVisionPredictionClient' #210

Open
ShamineDsouza opened this issue Feb 21, 2021 · 2 comments

Comments

@ShamineDsouza
Copy link

Microsoft.Azure.CognitiveServices.Vision.CustomVision.Prediction.Models.CustomVisionErrorException: 'Operation returned an invalid status code 'NotFound''
Error : Detail
| Body | {Microsoft.Azure.CognitiveServices.Vision.CustomVision.Prediction.Models.CustomVisionError} | Microsoft.Azure.CognitiveServices.Vision.CustomVision.Prediction.Models.CustomVisionError
  | Code | "NotFoundIteration" | string
  | Message | "Invalid iteration" | string

Above is the error , I am getting when running to test the prediction model.
Error is returned on this line of code
var result = predictionApi.DetectImage(project.Id, lstIteration[0].Name, stream);

Sample Code :

private void TestIteration(CustomVisionPredictionClient predictionApi, Project project, IList lstIteration)
{
var imageFile = Server.MapPath("~/" + imgPath);
using (var stream = File.OpenRead(imageFile))
{
var result = predictionApi.DetectImage(project.Id, lstIteration[0].Name, stream);
foreach (var c in result.Predictions)
{
Console.WriteLine($"\t{c.TagName}: {c.Probability:P1} [ {c.BoundingBox.Left}, {c.BoundingBox.Top}, {c.BoundingBox.Width}, {c.BoundingBox.Height} ]");
}
}
}

@aitchkhan
Copy link

what was the issue? getting a similar issue

@ShamineDsouza
Copy link
Author

ShamineDsouza commented Aug 23, 2022

The iteration number mentioned is not correct. Check the iteration number in custom model, on which it is trained .
The iteration number changes every time it is trained / predicted.

Eg: Iteration1 --> Iteration2

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