CodeProject.AI Version 2.5

Do you have multi-TPU enabled? You may also want to watch the memory usage of CPAI, it's possible that there's a memory leak.

I never changed the multi TPU so it should be default. Since that PC is blocked from the internet again I'll type what I think you are referring to.

** CPAI_CORAL_MULTI_TPU = false

I also just checked the memory and CodeProject..AI.Server is using 374 MB memory. It's fluctuating up and down 2-3 MB but when I started replying it was only at 295 MB. (I'm slow going back and forth between computers and typing LOL). The difference it is going up even if minimal. I'll keep an eye on it now since it is going up. It was only started 7 hours ago so the rate at leaking I can see that being an issue.

Is the memory leak a known issue? Is there a version I should revert to?

Unfortunately I didn't keep track of the CPAI versions since I usually use the logs and since part of the process is to uninstall and delete the folder I doubt there is a way to tell. However, looking at my downloads folder, I do see I have the following (created dates):

2.0.8 (5/13/2023)
2.4.7 (1/11/2024)
2.5.0 RC8 (1/20/2024)
2.5.1 (1/26/2024)

I'm pretty sure I used 2.0.8 with CPU/GPU until I got the TPU running on 1/8/2024. I also had issues with GPU until recently so was using CPU (I think it might have been drivers or Windows).

The AI times in BI are ranging between 87 and 172 ms (roughly as I skim through the log) with Coral TPU. If memory serves me correct, with the GPU they were in the 200-300 ms and CPU was 300-400 ms (both medium model size).

I didn't mind the slow response but when a few cameras trigger at once it pegs the CPU and I'm pretty sure that was the reason I lost some triggers (again that was before GPU was working which is why I ordered the TPU).

Again, if there is any recommendations, I'm open to them. What causes the AI: error 500? I had over a dozen in the last hour.

Almost debating getting another BI license and running on VM server so I can keep one machine stable (current version minus X) and then second machine to upgrade and test.

Thanks for the help.
 
Alright. I've been worried about a particular memory leak in the multi-TPU code, but no one has mentioned it, so maybe it's not a problem in practice. It's still worth watching for, however. I'm afraid I probably can't help you with the 500 error.
 
I'm experiencing the same thing as AlwaysSomething described. My Blue Iris and CPAI versions are the same, and I also use the Coral TPU. With this setup, I'm also getting the 500 error, where before I didn't.
 
I'm having the same issue with .net going to lost contact. Did a full clean install.

Despite showing lost contact, it does seem to be still working however. IIRC earlier versions had that cosmetic bug too.
 
Great write-up. Thanks Mike!
What is the recommended Object Detection Module? Yolo.NET or 5.6.2 for my Nvidia GTX 1050 Ti?
I find the Object Detection (YOLOv5 .NET) module to be faster with my RTX 3060. With v2.5.1 they added Status Data to the Info. If you want to see which is faster for your GPU run each module for about a day and compare the Average Inference ms

1706372412905.png
 
So checked the CPAI memory now and it's down to 103 MB. So I don't think there is a memory leak. I also looked at the logs to see if there were any restarts and there were't any. Still got lots of AI: error 500

For those with Lost Contact errors. I have that when the CPAI first starts. Wait a minute and then it goes away and doesn't come back (unless you stop and start again). It may just be part of the start up cycle.
 
Encountering ALPR 2.9.0 error during install. Any suggestions?
(I also tried CUDA 11.8 prior to 12.2. Both ALPR only CPU.)

ALPR installs with CPU only. Yolo v5 + Yolo v8 CUDA works. Win10 + GTX 1070ti

20:29:27:ALPR: CUDA Present...Yes (CUDA 12.2, cuDNN 8.9.7.29)
20:31:02:ALPR: ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
20:31:02:ALPR: paddlepaddle-gpu 2.5.1.post120 requires protobuf<=3.20.2,>=3.1.0; platform_system == "Windows", but you have protobuf 4.24.4 which is incompatible.

Also seeing BI 5.8.5.3 have "ALPR for plates" option greyed out?
On an older working production install with BI 5.8.2.2 + CP 2.2.4 with ALPR 2.6 (CUDA) it also has "ALPR for plates" greyed out but checked enabled? Not adjustable like guide screenshot.
 
  • Like
Reactions: David L
Windows 10 Nvidia Gforce RTX 2060 CUDA Version. I am highly confused. In all the documentation I see that I should be using CUDA ver 11.8. But, I am seeing a lot of people using CUDA ver 12.2. I am on the latest version of BI and CPAI. Which CUDA version do I use?
 
Windows 10 Nvidia Gforce RTX 2060 CUDA Version. I am highly confused. In all the documentation I see that I should be using CUDA ver 11.8. But, I am seeing a lot of people using CUDA ver 12.2. I am on the latest version of BI and CPAI. Which CUDA version do I use?
I recommend just use CUDA 11.8 because the cuDNN install script is for CUDA 11.x. If you install CUDA 12.x you will need to manually install cuDNN for CUDA 12.x
 
  • Like
Reactions: swilliams76360
Encountering ALPR 2.9.0 error during install. Any suggestions?
(I also tried CUDA 11.8 prior to 12.2. Both ALPR only CPU.)

ALPR installs with CPU only. Yolo v5 + Yolo v8 CUDA works. Win10 + GTX 1070ti

20:29:27:ALPR: CUDA Present...Yes (CUDA 12.2, cuDNN 8.9.7.29)
20:31:02:ALPR: ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
20:31:02:ALPR: paddlepaddle-gpu 2.5.1.post120 requires protobuf<=3.20.2,>=3.1.0; platform_system == "Windows", but you have protobuf 4.24.4 which is incompatible.

Also seeing BI 5.8.5.3 have "ALPR for plates" option greyed out?
On an older working production install with BI 5.8.2.2 + CP 2.2.4 with ALPR 2.6 (CUDA) it also has "ALPR for plates" greyed out but checked enabled? Not adjustable like guide screenshot.
Post a screenshot of your main AI settings
 
I recommend just use CUDA 11.8 because the cuDNN install script is for CUDA 11.x. If you install CUDA 12.x you will need to manually install cuDNN for CUDA 12.x
with that said, for the graphics driver, do i keep it as the 516.94 or upgrade to the newer driver...a little background on the issue i am having. I have 2 people registered in Facial Rec. I have about 50 images of each person. I can use control panel to manually select each picture and it returns with the correct name. However, when an alert is triggered, if it detects the 2nd person, it will list it as the 1st person. Even in the analysis it shows the name of the first person, not the 2nd person. I have fully uninstalled and reinstalled cpai and have deleted both persons images and readded them. I used DB Browser and was able to see both people listed in the facialrec db. This issue started a few versions back. I am not sure if this is a CPAI or BI issue, but i am getting ready to do a full wipe of both including CUDA and reload everything. I feel as though I am missing something, but I am not sure. As a side note, I have been using CUDA 11.8 cuDNN 8.5 and driver version 516.94 even though system info in cpai shows CUDA 11.7
 
with that said, for the graphics driver, do i keep it as the 516.94 or upgrade to the newer driver...a little background on the issue i am having. I have 2 people registered in Facial Rec. I have about 50 images of each person. I can use control panel to manually select each picture and it returns with the correct name. However, when an alert is triggered, if it detects the 2nd person, it will list it as the 1st person. Even in the analysis it shows the name of the first person, not the 2nd person. I have fully uninstalled and reinstalled cpai and have deleted both persons images and readded them. I used DB Browser and was able to see both people listed in the facialrec db. This issue started a few versions back. I am not sure if this is a CPAI or BI issue, but i am getting ready to do a full wipe of both including CUDA and reload everything. I feel as though I am missing something, but I am not sure. As a side note, I have been using CUDA 11.8 cuDNN 8.5 and driver version 516.94 even though system info in cpai shows CUDA 11.7
I have not used the Face Recognition module. From you post it looks like a Blue Iris issue because it is working using CodeProject.AI Explorer.
You can upgrade the GPU driver to the current version because they are backward compatible with CUDA.
 
I have not used the Face Recognition module. From you post it looks like a Blue Iris issue because it is working using CodeProject.AI Explorer.
You can upgrade the GPU driver to the current version because they are backward compatible with CUDA.
Roger that...thanks for the info, and continue doing the excellent job you all do...other than just a few minor issues, I have always been satisfied with CPAI
 
Encountering ALPR 2.9.0 error during install. Any suggestions?
(I also tried CUDA 11.8 prior to 12.2. Both ALPR only CPU.)

ALPR installs with CPU only. Yolo v5 + Yolo v8 CUDA works. Win10 + GTX 1070ti

20:29:27:ALPR: CUDA Present...Yes (CUDA 12.2, cuDNN 8.9.7.29)
20:31:02:ALPR: ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
20:31:02:ALPR: paddlepaddle-gpu 2.5.1.post120 requires protobuf<=3.20.2,>=3.1.0; platform_system == "Windows", but you have protobuf 4.24.4 which is incompatible.

Also seeing BI 5.8.5.3 have "ALPR for plates" option greyed out?
On an older working production install with BI 5.8.2.2 + CP 2.2.4 with ALPR 2.6 (CUDA) it also has "ALPR for plates" greyed out but checked enabled? Not adjustable like guide screenshot.
What CPU generation are you using? I have a 1080ti in another PC that was thinking making my new BI/CPAI box. It is a 6th Gen i7...

1706463278098.png
 
What CPU generation are you using? I have a 1080ti in another PC that was thinking making my new BI/CPAI box. It is a 6th Gen i7...

View attachment 184484


Your PC there will no doubt be able to run BI+ codeproject together provided you don't have tons of cams or need for many UI3 streams. Just be selective small with codeproject models.

This test system is my main workstation using 8700K @ 4.7. But its just for small 2 cam install and is separate from BI which is on a VMware cluster. I launch codeproject service + change BI profile when I leave home.

The primary limitation with these cards is RAM. Especially if BI does the decoding with lots of UI3 sessions. Also with Nvidia's greed of limiting desktop GPUs encoder sessions, if your BI is going to have the need to UI3 stream cam feeds to multiple clients search google/github for "nvidia encoder patch"

To give an idea of video ram: The main system I support 8 cam 1440P, BI in VM with GTX 1650 passthrough. Records + streams to 6-8 UI3 clients. Uses 3-3.5GB vRAM. Encoder engine ~40-60%. Decoder ~25%.
The Codeproject is on a separate Ryzen 5900x workstation with RTX 3050. With Yolov5 6.2 ipcam-combined,ipcam-dark, licenseplate + ALPR it after a week its uses ~6GB vRAM. All cams armed at night + handful armed during day. It barely uses GPU aside from consuming ~70-80% of its vRAM. I'd like to test its environment more with the face processing but its a no go with RTX 3050GB only having 8GB of RAM + its intended purpose of still being a useable business workstation.

I've been trying to get BI dev to re-visit Nvidia encoder (NVENC) as there is currently an undesirable behavior with Ui3 encoding in that is forces constant bit rate when NVENC is used. The Ui3 stream profile "limit bandwidth" setting really means set CBR @ X kbps, not the cap limit in VBR. I'm told to not use NVENC as its beta. BI NVENC been in beta for a very long time. It works but don't expect much support surrounding it.

Now onto somehow get out of python dependency hell and get a working ALPR 2.9 on codeproject 2.5.1. Anyone have suggestions why: paddlepaddle-gpu 2.5.1.post120 requires protobuf<=3.20.2,>=3.1.0; platform_system == "Windows", but you have protobuf 4.24.4 which is incompatible.
 
  • Like
Reactions: David L
Post a screenshot of your main AI settings

Missed this response. Not sure if you wanted some CP or BI screenshots so I did both.

12:26:04:preparing to install module 'ALPR'
12:26:04:Downloading module 'ALPR'
12:26:05:Installing module 'ALPR'
12:26:05:ALPR: Installing CodeProject.AI Analysis Module
12:26:05:ALPR: ======================================================================
12:26:05:ALPR: CodeProject.AI Installer
12:26:05:ALPR: ======================================================================
12:26:05:ALPR: 666.2Gb of 915Gb available on
12:26:05:ALPR: os, arch = windows x86_64
12:26:05:ALPR: systemName, platform = Windows, windows
12:26:05:ALPR: setupMode = InstallModule
12:26:05:ALPR: executionEnvironment = Production
12:26:05:ALPR: rootDirPath = C:\Program Files\CodeProject\AI
12:26:05:ALPR: appRootDirPath = C:\Program Files\CodeProject\AI\
12:26:05:ALPR: setupScriptDirPath = C:\Program Files\CodeProject\AI\
12:26:05:ALPR: sdkScriptsDirPath = C:\Program Files\CodeProject\AI\SDK\Scripts
12:26:05:ALPR: runtimesDirPath = C:\Program Files\CodeProject\AI\runtimes
12:26:05:ALPR: modulesDirPath = C:\Program Files\CodeProject\AI\modules
12:26:06:ALPR: downloadDirPath = C:\Program Files\CodeProject\AI\downloads
12:26:06:ALPR: General CodeProject.AI setup
12:26:06:ALPR: Creating Directories...Done
12:26:06:ALPR: GPU support
12:26:07:ALPR: CUDA Present...Yes (CUDA 12.2, cuDNN 8.9.7.29)
12:26:07:ALPR: ROCm Present...No
12:26:07:ALPR: Reading ALPR settingsUsed modulesettings.json to get value License Plate Reader
12:26:08:ALPR: .Used modulesettings.json to get value 2.9.0
12:26:08:ALPR: .Used modulesettings.windows.json to get value python3.7
12:26:08:ALPR: .Used modulesettings.json to get value Local
12:26:08:ALPR: .Used modulesettings.json to get value ALPR_adapter.py
12:26:09:ALPR: .Used modulesettings.windows.json to get value true
12:26:09:ALPR: .Used modulesettings.json to get value ["all"]
12:26:09:ALPR: .Done
12:26:09:ALPR: Installing module License Plate Reader 2.9.0
12:26:09:ALPR: Variable Dump
12:26:09:ALPR: moduleName = License Plate Reader
12:26:09:ALPR: moduleVersion = 2.9.0
12:26:09:ALPR: runtime = python3.7
12:26:09:ALPR: runtimeLocation = Local
12:26:09:ALPR: installGPU = true
12:26:09:ALPR: pythonVersion = 3.7
12:26:09:ALPR: virtualEnvDirPath = C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python37\venv
12:26:09:ALPR: venvPythonCmdPath = C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python37\venv\Scripts\python.exe
12:26:09:ALPR: packagesDirPath = C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python37\venv\Lib\site-packages
12:26:09:ALPR: moduleStartFilePath = ALPR_adapter.py
12:26:09:ALPR: Installing Python 3.7
12:26:09:ALPR: Installing python37 in C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37
12:26:09:ALPR: Python 3.7 is already installed
12:26:09:ALPR: Creating Virtual Environment (Local)...Virtual Environment doesn't exist. Creating at C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python37\venv
12:26:14:ALPR: Done
12:26:14:ALPR: Confirming we have Python 3.7 in our virtual environment...present
12:26:14:ALPR: Downloading paddleocr-models.zip to C:\Program Files\CodeProject\AI\downloads\ALPR\paddleocr
12:26:14:ALPR: Downloading ALPR models...Checking 'C:\Program Files\CodeProject\AI\downloads\ALPR\paddleocr-models.zip'
12:26:14:ALPR: already exists...Expanding...Heading to C:\Program Files\CodeProject\AI\downloads\ALPR
12:26:14:ALPR: Extracting paddleocr-models.zip
12:26:14:ALPR: Done.
12:26:14:ALPR: Copying contents of paddleocr-models.zip to paddleocr...done
12:26:14:ALPR: Installing Python packages for License Plate Reader
12:26:14:ALPR: [0;Installing GPU-enabled libraries: If available
12:26:15:ALPR: Ensuring Python package manager (pip) is installed...Looking in links: c:\WINDOWS\TEMP\tmptlu92pdr
12:26:15:ALPR: Requirement already satisfied: setuptools in c:\program files\codeproject\ai\modules\alpr\bin\windows\python37\venv\lib\site-packages (47.1.0)
12:26:15:ALPR: Requirement already satisfied: pip in c:\program files\codeproject\ai\modules\alpr\bin\windows\python37\venv\lib\site-packages (20.1.1)
12:26:15:ALPR: Done
12:26:23:ALPR: Ensuring Python package manager (pip) is up to date...Done
12:26:23:ALPR: Requirements Search Path is C:\Program Files\CodeProject\AI\modules\ALPR
12:26:23:ALPR: Searching for a suitable requirements.txts file in C:\Program Files\CodeProject\AI\modules\ALPR
12:26:23:ALPR: CUDA version is 12.2 (12_2 / 12)
12:26:23:ALPR: Python packages specified by requirements.windows.cuda12.txt
12:26:23:ALPR: Choosing Python packages from C:\Program Files\CodeProject\AI\modules\ALPR\requirements.windows.cuda12.txt
12:26:34:Response timeout. Try increasing the timeout value
12:26:52:ALPR: - Installing PaddlePaddle, Parallel Distributed Deep Learning...(checked) Done
12:27:34:ALPR: ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
12:27:34:ALPR: paddlepaddle-gpu 2.5.1.post120 requires protobuf<=3.20.2,>=3.1.0; platform_system == "Windows", but you have protobuf 4.24.4 which is incompatible.
12:27:36:ALPR: - Installing PaddleOCR, the OCR toolkit based on PaddlePaddle...(checked) Done
12:27:38:ALPR: - Installing imutils, the image utilities library...(checked) Done
12:27:40:ALPR: - Installing Pillow, a Python Image Library...Already installed
12:27:41:ALPR: - Installing OpenCV, the Computer Vision library for Python...Already installed
12:27:42:ALPR: - Installing NumPy, a package for scientific computing...Already installed
12:27:42:ALPR: Installing Python packages for the CodeProject.AI Server SDK
12:27:43:ALPR: Ensuring Python package manager (pip) is installed...Looking in links: c:\WINDOWS\TEMP\tmpwp_pdzky
12:27:43:ALPR: Requirement already satisfied: setuptools in c:\program files\codeproject\ai\modules\alpr\bin\windows\python37\venv\lib\site-packages (68.0.0)
12:27:43:ALPR: Requirement already satisfied: pip in c:\program files\codeproject\ai\modules\alpr\bin\windows\python37\venv\lib\site-packages (23.3.2)
12:27:43:ALPR: Done
12:27:46:ALPR: Ensuring Python package manager (pip) is up to date...Done
12:27:46:ALPR: Requirements Search Path is C:\Program Files\CodeProject\AI\SDK\Python
12:27:46:ALPR: Searching for a suitable requirements.txts file in C:\Program Files\CodeProject\AI\SDK\Python
12:27:46:ALPR: CUDA version is 12.2 (12_2 / 12)
12:27:46:ALPR: Python packages specified by requirements.txt
12:27:46:ALPR: Choosing Python packages from C:\Program Files\CodeProject\AI\SDK\Python\requirements.txt
12:27:47:ALPR: - Installing Pillow, a Python Image Library...Already installed
12:27:49:ALPR: - Installing Charset normalizer...Already installed
12:27:53:ALPR: - Installing aiohttp, the Async IO HTTP library...(checked) Done
12:27:56:ALPR: - Installing aiofiles, the Async IO Files library...(checked) Done
12:27:59:ALPR: - Installing py-cpuinfo to allow us to query CPU info...(checked) Done
12:28:00:ALPR: - Installing Requests, the HTTP library...Already installed
12:28:00:ALPR: SELF TEST START ======================================================
12:28:10:ALPR: Running verify PaddlePaddle program ...
12:28:10:ALPR: PaddlePaddle works well on 1 GPU.
12:28:10:ALPR: PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.
12:28:10:ALPR: Self-test passed
12:28:10:ALPR: SELF TEST END ======================================================
12:28:10:ALPR: Module setup time 00:02:02.96
12:28:10:ALPR: Setup complete
12:28:10:ALPR: Total setup time 00:02:04.85
12:28:10:Module ALPR installed successfully.
12:28:10:
12:28:10:Module 'License Plate Reader' 2.9.0 (ID: ALPR)
12:28:10:Valid: True
12:28:10:Module Path: <root>\modules\ALPR
12:28:10:AutoStart: True
12:28:10:Queue: alpr_queue
12:28:10:Runtime: python3.7
12:28:10:Runtime Loc: Local
12:28:10:FilePath: ALPR_adapter.py
12:28:10:pre installed: False
12:28:10:Start pause: 3 sec
12:28:10:LogVerbosity:
12:28:10:platforms: all
12:28:10:GPU Libraries: installed if available
12:28:10:GPU Enabled: enabled
12:28:10:parallelism: 0
12:28:10:Accelerator:
12:28:10:Half Precis.: enable
12:28:10:Environment Variables
12:28:10:AUTO_PLATE_ROTATE = True
12:28:10:MIN_COMPUTE_CAPABILITY = 7
12:28:10:MIN_CUDNN_VERSION = 7
12:28:10:OCR_OPTIMAL_CHARACTER_HEIGHT = 60
12:28:10:OCR_OPTIMAL_CHARACTER_WIDTH = 36
12:28:10:OCR_OPTIMIZATION = True
12:28:10:pLATE_CONFIDENCE = 0.7
12:28:10:pLATE_RESCALE_FACTOR = 2
12:28:10:pLATE_ROTATE_DEG = 0
12:28:10:
12:28:10:Started License Plate Reader module
12:28:10:Installer exited with code 0
12:28:13:Module ALPR started successfully.
12:28:14:ALPR_adapter.py: Running init for License Plate Reader



ALPR-290-Info.JPG

CP251-Modules.JPG




BI-AI-Global.JPG

BI-Cam-AI.JPG
 

Attachments

  • CP-Modules.JPG
    CP-Modules.JPG
    32.9 KB · Views: 14
Last edited: