CodeProjectAI errors

alecz

Young grasshopper
May 16, 2023
61
11
Montreal
I have a freshly installed (licensed) BlueIris 5 setup and it suggested to use CodeProjectAI. Since this is on a beefier machine, i decided to give it a try.
I installed CodeProject.AI-Server_2.9.5_win_x64 with the default options which installed 3 modules:
  1. Face Processing 1.12.3
  2. Object Detection (YOLOv5 .NET) 1.14.0
  3. Object Detection (YOLOv5 6.2) 1.10.0
When the service starts, it spawns a webserver at
System Details:
(System is VM runing in Proxmox with the Intel UHD 630 passed through.

Code:
12:49:27:System:           Windows
12:49:27:Operating System: Windows (Windows 10 Redstone)
12:49:27:CPUs:             Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz (Intel)
12:49:27:                  1 CPU x 4 cores. 4 logical processors (x64)
12:49:27:GPU (Primary):    Intel(R) UHD Graphics 630 (1,024 MiB) (Intel Corporation)
12:49:27:                  Driver: 31.0.101.2111
12:49:27:System RAM:       10 GiB
12:49:27:Platform:         Windows
12:49:27:BuildConfig:      Release
12:49:27:Execution Env:    Native
12:49:27:Runtime Env:      Production
12:49:27:Runtimes installed:
12:49:27:  .NET runtime:     9.0.0
12:49:27:  .NET SDK:         Not found
12:49:27:  Default Python:   Not found
12:49:27:  Go:               Not found
12:49:27:  NodeJS:           Not found
12:49:27:  Rust:             Not found

However, in the status, I see that some modules randomly appear to fail to start with the following errors:
Code:
12:49:42:Object Detection (YOLOv5 .NET): Object Detection (YOLOv5 .NET) module started.
12:49:44:detect_adapter.py: Traceback (most recent call last):
12:49:44:detect_adapter.py:   File "C:\Program Files\CodeProject\AI\modules\ObjectDetectionYOLOv5-6.2\detect_adapter.py", line 25, in
12:49:44:detect_adapter.py:     from detect import do_detection
12:49:44:detect_adapter.py:   File "C:\Program Files\CodeProject\AI\modules\ObjectDetectionYOLOv5-6.2\detect.py", line 8, in
12:49:44:detect_adapter.py:     from yolov5.models.common import DetectMultiBackend, AutoShape
12:49:44:detect_adapter.py: ModuleNotFoundError: No module named 'yolov5'
12:49:44:Module ObjectDetectionYOLOv5-6.2 has shutdown
12:49:44:detect_adapter.py: has exited

and

Code:
 True
12:50:54:
12:50:54:Started Object Detection (YOLOv5 .NET) module
12:50:59:ObjectDetectionYOLOv5Net.exe:       Application started. Press Ctrl+C to shut down.
12:50:59:ObjectDetectionYOLOv5Net.exe:       Hosting environment: Production
12:50:59:ObjectDetectionYOLOv5Net.exe:       Content root path: C:\Program Files\CodeProject\AI\modules\ObjectDetectionYOLOv5Net
12:51:00:Object Detection (YOLOv5 .NET): Object Detection (YOLOv5 .NET) module started.
12:51:05:ObjectDetectionYOLOv5Net.exe: Fatal error. 0xC0000005
12:51:05:ObjectDetectionYOLOv5Net.exe:    at Microsoft.ML.OnnxRuntime.InferenceSession.Init(Byte[], Microsoft.ML.OnnxRuntime.SessionOptions, Microsoft.ML.OnnxRuntime.PrePackedWeightsContainer)
12:51:05:ObjectDetectionYOLOv5Net.exe:    at Microsoft.ML.OnnxRuntime.InferenceSession..ctor(Byte[], Microsoft.ML.OnnxRuntime.SessionOptions)
12:51:05:System.__Canon, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e: ..ctor(System.String, Microsoft.ML.OnnxRuntime.SessionOptions)
12:51:05:ObjectDetectionYOLOv5Net.exe:    at CodeProject.AI.Modules.ObjectDetection.YOLOv5.ObjectDetector..ctor(System.String, Microsoft.Extensions.Logging.ILogger`1)

...

12:51:05:ObjectDetectionYOLOv5Net.exe:    at System.Threading.PortableThreadPool+IOCompletionPoller+Callback.Invoke(Event)
12:51:05:System.Threading.PortableThreadPool+IOCompletionPoller+Event, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Threading.PortableThreadPool+IOCompletionPoller+Callback, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e: .System.Threading.IThreadPoolWorkItem.Execute()
12:51:05:ObjectDetectionYOLOv5Net.exe:    at System.Threading.ThreadPoolWorkQueue.Dispatch()
12:51:05:ObjectDetectionYOLOv5Net.exe:    at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
12:51:08:Module ObjectDetectionYOLOv5Net has shutdown
12:51:08:ObjectDetectionYOLOv5Net.exe: has exited
12:55:55:Response rec'd from Object Detection (YOLOv5 .NET) command 'detect' (...c58e1b) ['Found car']  took 4988ms
12:56:09:Response rec'd from Object Detection (YOLOv5 .NET) command 'detect' (...b47ee4) ['Found car']  took 279ms

So it fails to start, it exists, but it detects objects?

In the module summary it says:

  1. Face Processing 1.12.3 - Stopped
  2. Object Detection (YOLOv5 .NET) 1.14.0 Started GPU (DirectML)
  3. Object Detection (YOLOv5 6.2) 1.10.0 CPU

Do I need both YOLOv5 object detection modules?
Should I just keep the .NET one despite the huge error stack since it eventually appears to work and use the GPU?

Any ideas on how to fix the errors:

12:50:21:detect_adapter.py: ModuleNotFoundError: No module named 'yolov5'
 
I remember detect_adapter.py: ModuleNotFoundError: No module named 'yolov5' from long ago when i just started out, i believe a complete uninstall (check that all files are deleted) and reinstall fixed it for me.
I wasn't patient and kept clicking in the AI overview when it was installing, i think it messed something up.
 
  • Like
Reactions: alecz
This error is usually caused by compatibility issues with OnnxRuntime and GPU drivers and you should update the Intel UHD 630 driver to the latest version.
Thanks for the suggestion, but Windows 10 says it is already using the latest driver. Any idea which "latest" version is good?

BTW, the Object Detection (YOLOv5 .NET) 1.14.0 seems to work fine now. It's just the Object Detection (YOLOv5 6.2) 1.10.0 that gives the Python error.

I haven't done the comlpete uninstall and re-install yet as I am getting some AI verified alerts that I don't want to risk using just yet