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

System.InvalidOperationException: Failed to compare two elements in the array. #348

Open
apedance opened this issue Jun 10, 2024 · 5 comments

Comments

@apedance
Copy link

apedance commented Jun 10, 2024

Hey there,

thanks for your hard work.

I installed the latest beta 2.6.95 today. When I launch the tool I get following error message and the images are not processed. They just pile up in the queue.

getting next URL: System.InvalidOperationException: Failed to compare two elements in the array.
---> System.NullReferenceException: Object reference not set to an instance of an object.
at ThreadSafe.DateTime.op_Equality(DateTime tsd1, DateTime tsd2) in C:\Documents\Projects_GIT\VorlonCD\bi-aidetection - NET6\src\UI\ThreadSafe.cs:line 370
at ThreadSafe.DateTime.CompareTo(DateTime other) in C:\Documents\Projects_GIT\VorlonCD\bi-aidetection - NET6\src\UI\ThreadSafe.cs:line 219
at System.Linq.EnumerableSorter2.CompareAnyKeys(Int32 index1, Int32 index2) at System.Collections.Generic.ArraySortHelper1.IntroSort(Span1 keys, Int32 depthLimit, Comparison1 comparer)
at System.Collections.Generic.ArraySortHelper1.Sort(Span1 keys, Comparison1 comparer) --- End of inner exception stack trace --- at System.Collections.Generic.ArraySortHelper1.Sort(Span1 keys, Comparison1 comparer)
at System.Linq.EnumerableSorter2.QuickSort(Int32[] keys, Int32 lo, Int32 hi) at System.Linq.OrderedEnumerable1.ToList()
at AITool.AITOOL.WaitForNextURL(Camera cam, Boolean GetRefinementServer, List1 predictions, String RequiredLinkURLList, List1 MainURLs) in C:\Documents\Projects_GIT\VorlonCD\bi-aidetection - NET6\src\UI\AITOOL.cs:line 1108

I am using CodeProject AI and had no issues with previous versions.
Was running 2.6.40 perfectly fine.

@clowgg
Copy link

clowgg commented Jul 10, 2024

I am having the same error.
How do you downgrade to an older version? I installed AIToolSetup.2.6.54 over the top of .95, but it won't run. Splash screen comes up and then app never appears.

@VorlonCD
Copy link
Owner

Sorry, missed this. I think at least one solution is to rename or delete _Settings\AITool.Settings.JSON. Everything would have to be re-configured from scratch. It looks like something related to a stored date is empty/null in your config.

I'll add better error handling to that for the next release, but not sure when that might be.

I just wonder why it never happened to me during testing. Always used the same config file.

@clowgg
Copy link

clowgg commented Jul 10, 2024

I just discovered that if I untick 'Queued' in the AI Server URLs section of Settings, I don't get the errors.
I have 3 CodeProject AI URLs listed in the [Edit] screen.

@Yonny24
Copy link

Yonny24 commented Sep 17, 2024

following

@Yonny24
Copy link

Yonny24 commented Sep 18, 2024

I had returned to this great tool but yes this latest version was giving me a lot of issues.

I unticked the error box in the url server set up and also the mesh due to the error below

Failure response from 'CodeProject_AI_Custom'. Error='The request timed out...

and

Failure response from 'CodeProject_AI_Custom'. Error='Unable to run inference: There is at least 1 reference to internal data
in the interpreter in the form of a numpy array or slice. Be sure to
only hold the function returned from tensor() if you are using raw
data access.'. JSON: '{"success":false,"error":"Unable to run inference: There is at least 1 reference to internal data\n in the interpreter in the form of a numpy array or slice. Be sure to\n only hold the function returned from tensor() if you are using raw\n data access.","inferenceMs":0,"processMs":32,"predictions":[],"message":"","count":0,"moduleId":"ObjectDetectionCoral","moduleName":"Object Detection (Coral)","code":500,"command":"custom","requestId":"f0643618-2de2-4080-bf0a-e10c1b303ab0","inferenceDevice":"TPU","analysisRoundTripMs":58,"processedBy":"localhost","timestampUTC":"Wed, 18 Sep 2024 01:45:26 GMT"}'

Been at this for hours and it fills up with red logs

Failure response from 'CodeProject_AI_Custom'. Error='Unable to run inference: There is at least 1 reference to internal data
  in the interpreter in the form of a numpy array or slice. Be sure to
  only hold the function returned from tensor() if you are using raw
  data access.'. JSON: '{"success":false,"error":"Unable to run inference: There is at least 1 reference to internal data\n      in the interpreter in the form of a numpy array or slice. Be sure to\n      only hold the function returned from tensor() if you are using raw\n      data access.","inferenceMs":0,"processMs":21,"predictions":[],"message":"","count":0,"moduleId":"ObjectDetectionCoral","moduleName":"Object Detection (Coral)","code":500,"command":"custom","requestId":"087630a7-fae9-41f7-8103-e9aff04ee634","inferenceDevice":"TPU","analysisRoundTripMs":58,"processedBy":"localhost","timestampUTC":"Wed, 18 Sep 2024 01:51:17 GMT"}'

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

4 participants