question

BaruchShadrouz-1556 avatar image
0 Votes"
BaruchShadrouz-1556 asked ·

READ Task canceled: system.Threading.Tasks.TaskCanceledException: A task was canceled

I am getting some READ OCR errors that is printing the message shown in the screenshot below. I am using the code provided by Microsoft in their getting started guide. I am running the code with multiprocessing (4 cores) so there are multiple calls to the API at a time. I have the plan that allows me 10 calls per second so I don think making too many calls per second is the problem.
75470-image.png

Any help would be appreciated!


azure-cognitive-servicesazure-computer-vision
image.png (82.0 KiB)
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, can you please provide steps to reproduce this issue? If you have a repo to share that would be helpful as well. Thanks.

0 Votes 0 ·

1 Answer

GiftA-MSFT avatar image
0 Votes"
GiftA-MSFT answered ·

Also, ensure that you are using a 1 second interval between requests.

· 2 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I have a parent program that creates 6-8 forks of the Sample code that Microsoft has for the Cognitive Service READ. The files that are being passed to Microsoft are on my local machine. The only difference I have in my code from the Sample code is the output it saved to a file in a specific format.

Based on @GiftA-MSFT answer I am guessing that I would need to put a 1sec delay between the forks, correct?

Thank you


0 Votes 0 ·
GiftA-MSFT avatar image GiftA-MSFT BaruchShadrouz-1556 ·

Correct, you can call the API using parallel batch processing capped by the TPS limit. However, we recommend that you add a 1 second interval between API requests or tune the interval and observe the performance.

0 Votes 0 ·