My CodeProject.AI is apparently using an old python version (
C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37
), while I also have
Python 3.11.8
installed in windows. How can I, or should I, get CodeProject.AI to use a current Python version?
What I have tried:
CodeProject.AI system info:
Server version: 2.5.1
System: Windows
Operating System: Windows (Microsoft Windows 10.0.19045)
CPUs: 12th Gen Intel(R) Core(TM) i9-12900K (Intel)
1 CPU x 16 cores. 24 logical processors (x64)
GPU (Primary): NVIDIA GeForce RTX 2070 (8 GiB) (NVIDIA)
Driver: 537.34, CUDA: 12.2 (up to: 12.2), Compute: 7.5, cuDNN: 8.5
System RAM: 32 GiB
Platform: Windows
BuildConfig: Release
Execution Env: Native
Runtime Env: Production
.NET framework: .NET 7.0.15
Default Python:
Video adapter info:
NVIDIA GeForce RTX 2070:
Driver Version 31.0.15.3734
Video Processor NVIDIA GeForce RTX 2070
System GPU info:
GPU 3D Usage 12%
GPU RAM Usage 7.8 GiB
Global Environment variables:
CPAI_APPROOTPATH = <root>
CPAI_PORT = 32168
I'm using CPAI with:
Blue Iris 5.8.5.8 (2024-02-02)
I'm seeing errors like this in CodeProject.AI server logs:
06:19:36:Object Detection (YOLOv5 6.2): [RuntimeError] : Traceback (most recent call last):
File "C:\Program Files\CodeProject\AI\modules\ObjectDetectionYOLOv5-6.2\detect.py", line 141, in do_detection
det = detector(img, size=640)
File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\lib\site-packages\yolov5\models\common.py", line 705, in forward
y = self.model(x, augment=augment) # forward
File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\lib\site-packages\yolov5\models\common.py", line 515, in forward
y = self.model(im, augment=augment, visualize=visualize) if augment or visualize else self.model(im)
File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\Lib\site-packages\yolov5\models\yolo.py", line 209, in forward
return self._forward_once(x, profile, visualize) # single-scale inference, train
File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\Lib\site-packages\yolov5\models\yolo.py", line 121, in _forward_once
x = m(x) # run
File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\Lib\site-packages\yolov5\models\yolo.py", line 75, in forward
wh = (wh * 2) ** 2 * self.anchor_grid[i] # wh
RuntimeError: The size of tensor a (12) must match the size of tensor b (20) at non-singleton dimension 3
06:19:36:Object Detection (YOLOv5 6.2): Rec'd request for Object Detection (YOLOv5 6.2) command 'custom' (...e45c50) took 1072ms
Also note that CPAI has both python37 and python39 directories under
C:\Program Files\CodeProject\AI\runtimes\bin\windows\
, but at startup CPAI uses python37