Closed bzglm closed 4 years ago
Thank you for opening this issue! We are routing it to the appropriate team for follow up.
Has the UI to set an iteration as default been removed from the customvision.ai portal?
One thing, just to be sure: what value did you put in PredictionEndpoint
field?
Closing due to inactivity. Please re-open if you still have an issue with the new libraries: https://aka.ms/azsdk
Describe the bug The Microsoft.Azure.CognitiveServices.Vision.CustomVision.Prediction nuget package always throws an exception when trying to reach the CustomVision API ("Microsoft.Rest.HttpOperationException: 'Operation returned an invalid status code 'NotFound''), no matter the endpoint or the method (trying to to list projects does not work either)
Exception or Stack Trace at Microsoft.Azure.CognitiveServices.Vision.CustomVision.Prediction.CustomVisionPredictionClient.d26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.CognitiveServices.Vision.CustomVision.Prediction.CustomVisionPredictionClientExtensions.d 4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.CognitiveServices.Vision.CustomVision.Prediction.CustomVisionPredictionClientExtensions.PredictImage(ICustomVisionPredictionClient operations, Guid projectId, Stream imageData, Nullable`1 iterationId, String application)
Code Snippet HttpClient httpClient = new HttpClient(); CustomVisionPredictionClient customVisionPredictionClient = new CustomVisionPredictionClient(httpClient, false) { ApiKey = PredictionKey, Endpoint = PredictionEndpoint, }; using (var imageData = new FileStream(@"d:\input.png", FileMode.Open)) { var result = customVisionPredictionClient.PredictImage(ProjectGuid, imageData); }
Setup (please complete the following information):
Additional context As suggested on another bug report I have set a default iteration but that did not solve the issue (neither did providing its GUID as parameter). I have also tried several different endpoints for the API with no more success. Lastly I was able to reach the API using the deprecated Windows client library ( https://github.com/Microsoft/Cognitive-CustomVision-Windows/tree/master/ClientLibrary ) through the provided Windows sample. I have tried setting the exact same endpoint and obviously the correct information about my project but without getting more success.