Code Project AI 2.9.5 detect_adapter.py error

Bruce_H

Getting the hang of it
Feb 22, 2017
153
51
I have installed CPAI 2.9.5 on two systems running Windows 11, one of them works fine with no errors, the other has errors when I try and start any of the following modules
YOLOv5 6.2 and YOLOv8 the error is the same for all of them. Here is the excerpt form the install log for both modules

19:51:58:
19:51:58:Started Object Detection (YOLOv5 6.2) module
19:51:58:detect_adapter.py: Traceback (most recent call last):
19:51:58:detect_adapter.py: File "C:\Program Files\CodeProject\AI\modules\ObjectDetectionYOLOv5-6.2\detect_adapter.py", line 19, in
19:51:58:detect_adapter.py: has exited
19:51:58:Module ObjectDetectionYOLOv5-6.2 has shutdown
19:51:58:detect_adapter.py: from codeproject_ai_sdk import JSON, ModuleRunner, LogMethod, LogVerbosity, RequestData
19:51:58:detect_adapter.py: ModuleNotFoundError: No module named 'codeproject_ai_sdk'
19:51:59:Installing module 'ObjectDetectionYOLOv8'
19:51:59:Installer script at 'C:\Program Files\CodeProject\AI\setup.bat'
19:51:59:ObjectDetectionYOLOv8: Installing CodeProject.AI Analysis Module
19:51:59:ObjectDetectionYOLOv8: ======================================================================
19:51:59:ObjectDetectionYOLOv8: CodeProject.AI Installer
19:51:59:ObjectDetectionYOLOv8: ======================================================================
19:51:59:Module ObjectDetectionYOLOv5-6.2 started successfully.
19:52:00:ObjectDetectionYOLOv8: 346.5Gb of 476Gb available on (No label) (Windows 11 x86_64 - windows)
19:52:00:ObjectDetectionYOLOv8: General CodeProject.AI setup
19:52:00:ObjectDetectionYOLOv8: Checking for VC++ Redist...v14 Present.
19:52:00:ObjectDetectionYOLOv8: Creating Directories...done
19:52:00:ObjectDetectionYOLOv8: GPU support
19:52:01:ObjectDetectionYOLOv8: CUDA Present...Yes (CUDA 11.8, No cuDNN found, CUDA Toolkit: true)
19:52:01:ObjectDetectionYOLOv8: ROCm Present...No
19:52:01:ObjectDetectionYOLOv8: Checking for .NET 9.0...Checking runtimes...All good. Found .NET aspnetcore 9
19:52:04:ObjectDetectionYOLOv8: Reading ObjectDetectionYOLOv8 settings.......done
19:52:05:ObjectDetectionYOLOv8: Installing module Object Detection (YOLOv8) 1.6.2 (Internal)
19:52:05:ObjectDetectionYOLOv8: Installing Python 3.9
19:52:58:ObjectDetectionYOLOv8: Downloading Python 3.9 interpreter...Expanding...done.
19:53:15:ObjectDetectionYOLOv8: Creating Virtual Environment (Local)...done
19:53:15:ObjectDetectionYOLOv8: Confirming we have Python 3.9 in our virtual environment...present
19:53:15:ObjectDetectionYOLOv8: Installing Python packages for Object Detection (YOLOv8)
19:53:15:ObjectDetectionYOLOv8: [0;Installing GPU-enabled libraries: If available
19:53:17:ObjectDetectionYOLOv8: Ensuring Python package manager (pip) is installed...done
19:53:26:ObjectDetectionYOLOv8: Ensuring Python package manager (pip) is up to date...done
19:53:26:ObjectDetectionYOLOv8: Python packages specified by requirements.windows.cuda.txt
19:53:32:ObjectDetectionYOLOv8: - Installing NumPy, a package for scientific computing...(✅ checked) done
20:11:59:Module ObjectDetectionYOLOv8 installed successfully.
20:11:59:ObjectDetectionYOLOv8: - Installing PyTorch, an open source machine learning framework...
20:11:59:Module ObjectDetectionYOLOv8 not configured to AutoStart.
20:11:59:Unable to install ObjectDetectionYOLOv8: Timed out attempting to install Module 'ObjectDetectionYOLOv8' (A task was canceled.)

This particular system is on a very slow internet link (5Mbps) and may not have been able to download all the files properly, is there a way to pre-download all of the files to avoid timeouts during the install process?
 
I have installed CPAI 2.9.5 on two systems running Windows 11, one of them works fine with no errors, the other has errors when I try and start any of the following modules
YOLOv5 6.2 and YOLOv8 the error is the same for all of them. Here is the excerpt form the install log for both modules

19:51:58:
19:51:58:Started Object Detection (YOLOv5 6.2) module
19:51:58:detect_adapter.py: Traceback (most recent call last):
19:51:58:detect_adapter.py: File "C:\Program Files\CodeProject\AI\modules\ObjectDetectionYOLOv5-6.2\detect_adapter.py", line 19, in
19:51:58:detect_adapter.py: has exited
19:51:58:Module ObjectDetectionYOLOv5-6.2 has shutdown
19:51:58:detect_adapter.py: from codeproject_ai_sdk import JSON, ModuleRunner, LogMethod, LogVerbosity, RequestData
19:51:58:detect_adapter.py: ModuleNotFoundError: No module named 'codeproject_ai_sdk'
19:51:59:Installing module 'ObjectDetectionYOLOv8'
19:51:59:Installer script at 'C:\Program Files\CodeProject\AI\setup.bat'
19:51:59:ObjectDetectionYOLOv8: Installing CodeProject.AI Analysis Module
19:51:59:ObjectDetectionYOLOv8: ======================================================================
19:51:59:ObjectDetectionYOLOv8: CodeProject.AI Installer
19:51:59:ObjectDetectionYOLOv8: ======================================================================
19:51:59:Module ObjectDetectionYOLOv5-6.2 started successfully.
19:52:00:ObjectDetectionYOLOv8: 346.5Gb of 476Gb available on (No label) (Windows 11 x86_64 - windows)
19:52:00:ObjectDetectionYOLOv8: General CodeProject.AI setup
19:52:00:ObjectDetectionYOLOv8: Checking for VC++ Redist...v14 Present.
19:52:00:ObjectDetectionYOLOv8: Creating Directories...done
19:52:00:ObjectDetectionYOLOv8: GPU support
19:52:01:ObjectDetectionYOLOv8: CUDA Present...Yes (CUDA 11.8, No cuDNN found, CUDA Toolkit: true)
19:52:01:ObjectDetectionYOLOv8: ROCm Present...No
19:52:01:ObjectDetectionYOLOv8: Checking for .NET 9.0...Checking runtimes...All good. Found .NET aspnetcore 9
19:52:04:ObjectDetectionYOLOv8: Reading ObjectDetectionYOLOv8 settings.......done
19:52:05:ObjectDetectionYOLOv8: Installing module Object Detection (YOLOv8) 1.6.2 (Internal)
19:52:05:ObjectDetectionYOLOv8: Installing Python 3.9
19:52:58:ObjectDetectionYOLOv8: Downloading Python 3.9 interpreter...Expanding...done.
19:53:15:ObjectDetectionYOLOv8: Creating Virtual Environment (Local)...done
19:53:15:ObjectDetectionYOLOv8: Confirming we have Python 3.9 in our virtual environment...present
19:53:15:ObjectDetectionYOLOv8: Installing Python packages for Object Detection (YOLOv8)
19:53:15:ObjectDetectionYOLOv8: [0;Installing GPU-enabled libraries: If available
19:53:17:ObjectDetectionYOLOv8: Ensuring Python package manager (pip) is installed...done
19:53:26:ObjectDetectionYOLOv8: Ensuring Python package manager (pip) is up to date...done
19:53:26:ObjectDetectionYOLOv8: Python packages specified by requirements.windows.cuda.txt
19:53:32:ObjectDetectionYOLOv8: - Installing NumPy, a package for scientific computing...(✅ checked) done
20:11:59:Module ObjectDetectionYOLOv8 installed successfully.
20:11:59:ObjectDetectionYOLOv8: - Installing PyTorch, an open source machine learning framework...
20:11:59:Module ObjectDetectionYOLOv8 not configured to AutoStart.
20:11:59:Unable to install ObjectDetectionYOLOv8: Timed out attempting to install Module 'ObjectDetectionYOLOv8' (A task was canceled.)

This particular system is on a very slow internet link (5Mbps) and may not have been able to download all the files properly, is there a way to pre-download all of the files to avoid timeouts during the install process?
It looks like it timed out due to slow internet. Try editing appsettings.json and change "ModuleInstallTimeout": "00:20:00" to "ModuleInstallTimeout": "20:20:00"

1733793784752.png

1733793983597.png
 
Thanks MikeLud1, I will give that a try, the internet speed is only 5 Mbps max, it's out in the boonies on a slow DSL link!
 
Thanks MikeLud1, I will give that a try, the internet speed is only 5 Mbps max, it's out in the boonies on a slow DSL link!
MikeLud1, I edited the file, but when I re run the setup program it just replaces it, how do I run the install process without it replacing the edited "appsettings.json" file

OK I figured out how to reinstall the YOPLOv8 module, but when I try to reinstall I get a message "Response timeout. Try increasing the timeout value", here is the log file for the install of the YOPLOv8 module

22:54:51:Preparing to install module 'ObjectDetectionYOLOv8'
22:54:52:Downloading module 'ObjectDetectionYOLOv8'
22:54:52:Installing module 'ObjectDetectionYOLOv8'
22:54:52:ObjectDetectionYOLOv8: Installing CodeProject.AI Analysis Module
22:54:53:ObjectDetectionYOLOv8: ======================================================================
22:54:53:ObjectDetectionYOLOv8: CodeProject.AI Installer
22:54:53:ObjectDetectionYOLOv8: ======================================================================
22:54:53:ObjectDetectionYOLOv8: 343.5Gb of 476Gb available on (No label) (Windows 11 x86_64 - windows)
22:54:53:ObjectDetectionYOLOv8: General CodeProject.AI setup
22:54:54:ObjectDetectionYOLOv8: Checking for VC++ Redist...v14 Present.
22:54:54:ObjectDetectionYOLOv8: Creating Directories...done
22:54:54:ObjectDetectionYOLOv8: GPU support
22:54:54:ObjectDetectionYOLOv8: CUDA Present...Yes (CUDA 11.8, No cuDNN found, CUDA Toolkit: true)
22:54:55:ObjectDetectionYOLOv8: ROCm Present...No
22:54:55:ObjectDetectionYOLOv8: Checking for .NET 9.0...Checking runtimes...All good. Found .NET aspnetcore 9
22:54:58:ObjectDetectionYOLOv8: Reading ObjectDetectionYOLOv8 settings.......done
22:54:58:ObjectDetectionYOLOv8: Installing module Object Detection (YOLOv8) 1.6.2 (Internal)
22:54:58:ObjectDetectionYOLOv8: Installing Python 3.9
22:54:58:ObjectDetectionYOLOv8: Python 3.9 is already installed
22:55:02:ObjectDetectionYOLOv8: Creating Virtual Environment (Local)...done
22:55:02:ObjectDetectionYOLOv8: Confirming we have Python 3.9 in our virtual environment...present
22:55:02:ObjectDetectionYOLOv8: Installing Python packages for Object Detection (YOLOv8)
22:55:02:ObjectDetectionYOLOv8: [0;Installing GPU-enabled libraries: If available
22:55:04:ObjectDetectionYOLOv8: Ensuring Python package manager (pip) is installed...done
22:55:10:ObjectDetectionYOLOv8: Ensuring Python package manager (pip) is up to date...done
22:55:10:ObjectDetectionYOLOv8: Python packages specified by requirements.windows.cuda.txt
22:55:15:ObjectDetectionYOLOv8: - Installing NumPy, a package for scientific computing...(✅ checked) done
22:55:21:Response timeout. Try increasing the timeout value
 
Last edited:
MikeLud1, I edited the file, but when I re run the setup program it just replaces it, how do I run the install process without it replacing the edited "appsettings.json" file

OK I figured out how to reinstall the YOPLOv8 module, but when I try to reinstall I get a message "Response timeout. Try increasing the timeout value", here is the log file for the install of the YOPLOv8 module

22:54:51:Preparing to install module 'ObjectDetectionYOLOv8'
22:54:52:Downloading module 'ObjectDetectionYOLOv8'
22:54:52:Installing module 'ObjectDetectionYOLOv8'
22:54:52:ObjectDetectionYOLOv8: Installing CodeProject.AI Analysis Module
22:54:53:ObjectDetectionYOLOv8: ======================================================================
22:54:53:ObjectDetectionYOLOv8: CodeProject.AI Installer
22:54:53:ObjectDetectionYOLOv8: ======================================================================
22:54:53:ObjectDetectionYOLOv8: 343.5Gb of 476Gb available on (No label) (Windows 11 x86_64 - windows)
22:54:53:ObjectDetectionYOLOv8: General CodeProject.AI setup
22:54:54:ObjectDetectionYOLOv8: Checking for VC++ Redist...v14 Present.
22:54:54:ObjectDetectionYOLOv8: Creating Directories...done
22:54:54:ObjectDetectionYOLOv8: GPU support
22:54:54:ObjectDetectionYOLOv8: CUDA Present...Yes (CUDA 11.8, No cuDNN found, CUDA Toolkit: true)
22:54:55:ObjectDetectionYOLOv8: ROCm Present...No
22:54:55:ObjectDetectionYOLOv8: Checking for .NET 9.0...Checking runtimes...All good. Found .NET aspnetcore 9
22:54:58:ObjectDetectionYOLOv8: Reading ObjectDetectionYOLOv8 settings.......done
22:54:58:ObjectDetectionYOLOv8: Installing module Object Detection (YOLOv8) 1.6.2 (Internal)
22:54:58:ObjectDetectionYOLOv8: Installing Python 3.9
22:54:58:ObjectDetectionYOLOv8: Python 3.9 is already installed
22:55:02:ObjectDetectionYOLOv8: Creating Virtual Environment (Local)...done
22:55:02:ObjectDetectionYOLOv8: Confirming we have Python 3.9 in our virtual environment...present
22:55:02:ObjectDetectionYOLOv8: Installing Python packages for Object Detection (YOLOv8)
22:55:02:ObjectDetectionYOLOv8: [0;Installing GPU-enabled libraries: If available
22:55:04:ObjectDetectionYOLOv8: Ensuring Python package manager (pip) is installed...done
22:55:10:ObjectDetectionYOLOv8: Ensuring Python package manager (pip) is up to date...done
22:55:10:ObjectDetectionYOLOv8: Python packages specified by requirements.windows.cuda.txt
22:55:15:ObjectDetectionYOLOv8: - Installing NumPy, a package for scientific computing...(✅ checked) done
22:55:21:Response timeout. Try increasing the timeout value
I forgot to mention that after making the file change you need to restart CodeProject.AI service for the change to work.
 
OK I tried again, I uninstalled the failed install of YOLOV8, verified that the appsettings.json setting was set to "ModuleInstallTimeout": "20:20:00", stopped the "CodeProject.AI Server" service, verified that the folder "C:\Program Files\CodeProject\AI\modules\ObjectDetectionYOLOv8" was not present, restated the "CodeProject.AI Server" service, Started the YOLOv8 install at 6:56 am, the install finished with No Errors at 7:23 am for a total install time of about 27 minutes for that module.

Thanks again for the pointers on how to get the install to finish, perhaps you might want to adjust the default module timeout value going forward.

If you would like me to test a full install of CPAI with a different default timeout, just let me know I can completely remove CPAI and retest a full install at any time. I have 18 cameras, and the system has almost no activity at this time of year!
 
Last edited:
I forgot to mention that after making the file change you need to restart CodeProject.AI service for the change to work.
Hey Mike, do you know what the difference is in Codeproject 2.9.4 and 2.9.5? I have 2.9.5 installed and working and was just wondering. Thank you, Rick
 
Is it me or if the coral module working better? I went back to my gpu a while ago but tried coral again with this new version and appears to be functioning well.
I'll give it a few days chance.
I'm on 2.9.4 though not .5
 
Thank you Mike!
Not much in changes just some minor fixes

View attachment 209422
Thanks true. Maybe me just getting hopeful that the coral module and models are working better. Going to give it another chance - saving 23-30w an hour with an idling gpu and more when it's running hard. Plus the heat it gives off in summer (southern hermisphere here). I'll put it back in during winter LOL
Can't beat the gpu for accuracy that is for sure though

Not sure why cpai shows 2.9.4 when I pulled 2.9.5 (unraid)

1733919569867.png

1733917780071.png
 
Last edited:
  • Like
Reactions: Skinny1
Well at least with using the tpu coral I am saving energy during the summer months, as I get lots of tree/shade movements so the afternoons are very intensive on the system even with zones. So coral in summer and gpu in winter..