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

Analyze Image is not working #28

Closed
naveed-ahmad-biz opened this issue Sep 22, 2017 · 12 comments
Closed

Analyze Image is not working #28

naveed-ahmad-biz opened this issue Sep 22, 2017 · 12 comments

Comments

@naveed-ahmad-biz
Copy link

I get the following error when I Analyze the image

[14:13:52.548178]: VisionServiceClient is created
[14:13:52.559227]: Calling VisionServiceClient.AnalyzeImageAsync()...
[14:13:53.429685]: Microsoft.ProjectOxford.Vision.ClientException: Exception of type 'Microsoft.ProjectOxford.Vision.ClientException' was thrown.
at Microsoft.ProjectOxford.Vision.VisionServiceClient.HandleException(Exception exception)
at Microsoft.ProjectOxford.Vision.VisionServiceClient.b__42_1[TRequest,TResponse](Exception e)
at System.AggregateException.Handle(Func2 predicate) at Microsoft.ProjectOxford.Vision.VisionServiceClient.<SendAsync>d__422.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.ProjectOxford.Vision.VisionServiceClient.d__211.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 CallSite.Target(Closure , CallSite , Object ) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at Microsoft.ProjectOxford.Vision.VisionServiceClient.<AnalyzeImageAsync>d__19.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 System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at VisionAPI_WPF_Samples.AnalyzePage.d__2.MoveNext() in C:\projects\Research\Cognitive-Vision-Windows\Sample-WPF\AnalyzePage.xaml.cs:line 117
--- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at VisionAPI_WPF_Samples.AnalyzePage.d__3.MoveNext() in C:\projects\Research\Cognitive-Vision-Windows\Sample-WPF\AnalyzePage.xaml.cs:line 145
--- 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 System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at VisionAPI_WPF_Samples.ImageScenarioPage.d__15.MoveNext() in C:\projects\Research\Cognitive-Vision-Windows\Sample-WPF\ImageScenarioPage.cs:line 90

Screen Shot
https://prnt.sc/gog863

No changes made to the code or anything, the default is throwing an exception.

@stephenohair
Copy link

Getting the same error in both VS2015 and VS2017. Tried clean, rebuild, build. Tried 2 different valid API keys. Same error.

@cthrash
Copy link
Contributor

cthrash commented Oct 18, 2017

Hi folks - can you pull the latest source? The sample app now allows you to specify the endpoint address in addition to the API key. This is necessary because a given API key works only in a single endpoint/region (https://westus.api.cognitive.microsoft.com/vision/v1.0, for example). You can find the correct endpoint address on the Azure portal.

@imaji
Copy link

imaji commented Dec 1, 2017

Nope, still doing it.

You're not passing the URL into the client, and it's hard coded in a few places too.

@MMasey
Copy link

MMasey commented Jan 29, 2018

I'm also having the same issue.

[12:16:58.056441]: VisionServiceClient is created
[12:16:58.057945]: Calling VisionServiceClient.AnalyzeImageAsync()...
[12:16:58.947496]: Microsoft.ProjectOxford.Vision.ClientException: Exception of type 'Microsoft.ProjectOxford.Vision.ClientException' was thrown.
   at Microsoft.ProjectOxford.Vision.VisionServiceClient.HandleException(Exception exception)
   at Microsoft.ProjectOxford.Vision.VisionServiceClient.<SendAsync>b__42_1[TRequest,TResponse](Exception e)
   at System.AggregateException.Handle(Func`2 predicate)
   at Microsoft.ProjectOxford.Vision.VisionServiceClient.<SendAsync>d__42`2.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.ProjectOxford.Vision.VisionServiceClient.<AnalyzeImageAsync>d__21`1.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 CallSite.Target(Closure , CallSite , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at Microsoft.ProjectOxford.Vision.VisionServiceClient.<AnalyzeImageAsync>d__19.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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at VisionAPI_WPF_Samples.AnalyzePage.<AnalyzeUrl>d__2.MoveNext() in C:\Projects\Experiments\Cognitive-Vision-Windows\Sample-WPF\AnalyzePage.xaml.cs:line 117
--- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at VisionAPI_WPF_Samples.AnalyzePage.<DoWork>d__3.MoveNext() in C:\Projects\Experiments\Cognitive-Vision-Windows\Sample-WPF\AnalyzePage.xaml.cs:line 145
--- 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 System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at VisionAPI_WPF_Samples.ImageScenarioPage.<ShowPreviewAndDoWork>d__15.MoveNext() in C:\Projects\Experiments\Cognitive-Vision-Windows\Sample-WPF\ImageScenarioPage.cs:line 90

@shanmurugan
Copy link

shanmurugan commented Mar 3, 2018

Few places, you find these line in common among all .cs files
VisionServiceClient VisionServiceClient = new VisionServiceClient(SubscriptionKey)
Just replace it with
VisionServiceClient VisionServiceClient = new VisionServiceClient(SubscriptionKey, "https://westcentralus.api.cognitive.microsoft.com/vision/v1.0");
But the above endpoint is subjected to change for the zone you have subscribed vision api

@luthercrop
Copy link

Hi Shanmurugan,
Am still getting the above error even after using that endpoint

@shanmurugan
Copy link

@luthercrop Could you upload/send me the code snippet alone ?.

@luthercrop
Copy link

@shanmurugan sorry forgot to comeback here and update... i managed to sort it out ....my API had a problem but was able to fix it ...thanks

@yaswanthpalaghat
Copy link

I have encountered this error after multiple builds..please resolve..

[15:17:20.828295]: VisionServiceClient is created
[15:17:20.911300]: Calling VisionServiceClient.AnalyzeImageAsync()...
[15:17:50.338983]: Microsoft.ProjectOxford.Vision.ClientException: Exception of type 'Microsoft.ProjectOxford.Vision.ClientException' was thrown.
at Microsoft.ProjectOxford.Vision.VisionServiceClient.HandleException(Exception exception)
at Microsoft.ProjectOxford.Vision.VisionServiceClient.b__42_1[TRequest,TResponse](Exception e)
at System.AggregateException.Handle(Func2 predicate) at Microsoft.ProjectOxford.Vision.VisionServiceClient.<SendAsync>d__422.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.ProjectOxford.Vision.VisionServiceClient.d__211.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.ProjectOxford.Vision.VisionServiceClient.<AnalyzeImageAsync>d__20.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 System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at VisionAPI_WPF_Samples.AnalyzePage.d__1.MoveNext() in C:\Users\Mr\Desktop\vision-windows\Sample-WPF\AnalyzePage.xaml.cs:line 86
--- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at VisionAPI_WPF_Samples.AnalyzePage.d__3.MoveNext() in C:\Users\Mr\Desktop\vision-windows\Sample-WPF\AnalyzePage.xaml.cs:line 141
--- 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 System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at VisionAPI_WPF_Samples.ImageScenarioPage.d__15.MoveNext() in C:\Users\Mr\Desktop\vision-windows\Sample-WPF\ImageScenarioPage.cs:line 90

@SEBEIIMED
Copy link

yes just repmace by this code
Just replace it with
VisionServiceClient VisionServiceClient = new VisionServiceClient(SubscriptionKey, "https://westcentralus.api.cognitive.microsoft.com/vision/v1.0");

@itorian
Copy link

itorian commented Apr 20, 2018

Similar issue, fixed it here https://github.com/itorian/Cognitive-Vision-Windows

@cthrash
Copy link
Contributor

cthrash commented Sep 4, 2018

please reactivate if setting the endpoint does not solve your situation

@cthrash cthrash closed this as completed Sep 4, 2018
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

10 participants