|
Thanks Chris. I tried the suggested fix above and it seemed to work. I’ll update when I can.
|
|
|
|
|
FYI the 2.6.4 release reports the following log message:
Server: This is a new, unreleased version
|
|
|
|
|
Hi,
I'm running codeproject in a docker debian lxc within proxmox. I believe I've passed through the Coral USB TPU correctly as codeproject references 'TPU Dectected' in the logs, however next entry is 'Unable to find or initialise the Coral TPU. Falling back to CPU-only.'
Really unsure where to go from here so reaching out in the hope that someone can advise.
Thanks!
18:22:24:Started Object Detection (Coral) module
18:22:26:face.py: Vision AI services setup: Retrieving environment variables...
18:22:26:face.py: APPDIR: /app/preinstalled-modules/FaceProcessing/intelligencelayer
18:22:26:face.py: PROFILE: desktop_cpu
18:22:26:face.py: USE_CUDA: False
18:22:26:face.py: DATA_DIR: /etc/codeproject/ai
18:22:26:face.py: MODELS_DIR: /app/preinstalled-modules/FaceProcessing/assets
18:22:26:face.py: MODE: MEDIUM
18:22:26:face.py: Running init for Face Processing
18:22:51:objectdetection_coral_adapter.py: MODULE_PATH: /app/modules/ObjectDetectionCoral
18:22:51:objectdetection_coral_adapter.py: MODELS_DIR: /app/modules/ObjectDetectionCoral/assets
18:22:51:objectdetection_coral_adapter.py: CPAI_CORAL_MODEL_NAME: mobilenet ssd
18:22:51:objectdetection_coral_adapter.py: MODEL_SIZE: small
18:22:51:objectdetection_coral_adapter.py: CPU_MODEL_NAME: tf2_ssd_mobilenet_v2_coco17_ptq.tflite
18:22:51:objectdetection_coral_adapter.py: TPU_MODEL_NAME: tf2_ssd_mobilenet_v2_coco17_ptq_edgetpu.tflite
18:22:51:objectdetection_coral_adapter.py: TPU detected
18:22:51:objectdetection_coral_adapter.py: Running init for Object Detection (Coral)
18:22:51:objectdetection_coral_adapter.py: Input details: {'name': 'serving_default_input:0', 'index': 0, 'shape': array([ 1, 300, 300, 3], dtype=int32), 'shape_signature': array([ 1, 300, 300, 3], dtype=int32), 'dtype': , 'quantization': (0.007843137718737125, 127), 'quantization_parameters': {'scales': array([0.00784314], dtype=float32), 'zero_points': array([127], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}
18:22:51:objectdetection_coral_adapter.py: Unable to find or initialise the Coral TPU. Falling back to CPU-only.
18:22:51:objectdetection_coral_adapter.py: Output details: {'name': 'StatefulPartitionedCall:3;StatefulPartitionedCall:2;StatefulPartitionedCall:1;StatefulPartitionedCall:02', 'index': 252, 'shape': array([ 1, 20], dtype=int32), 'shape_signature': array([ 1, 20], dtype=int32), 'dtype': , 'quantization': (0.0, 0), 'quantization_parameters': {'scales': array([], dtype=float32), 'zero_points': array([], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}
18:22:51:objectdetection_coral_adapter.py: Using CPU
modified 15-Apr-24 16:12pm.
|
|
|
|
|
Thanks very much for your report. Could you please share your System Info tab from your CodeProject.AI Server dashboard, and installation log for the Coral module?
Thanks,
Sean Ewington
CodeProject
|
|
|
|
|
Thanks for the response, Sean.
After posting for help yesterday, I made the realisation that the TPU cannot be shared between multiple services. Frigate is already using my TPU successfully, so I suspect that's the issue.
In case this is the wrong assumption, I've pasted the info you requested below, thanks for the help!
Server version: 2.6.2
System: Docker (e1635ace6cb8)
Operating System: Linux (Ubuntu 22.04)
CPUs: Intel(R) Core(TM) i5-6500T CPU @ 2.50GHz (Intel)
1 CPU x 4 cores. 4 logical processors (x64)
System RAM: 31 GiB
Platform: Linux
BuildConfig: Release
Execution Env: Docker
Runtime Env: Production
Runtimes installed:
.NET runtime: 7.0.17
.NET SDK: Not found
Default Python: 3.10.12
Go: Not found
NodeJS: Not found
Rust: Not found
Video adapter info:
System GPU info:
GPU 3D Usage 0%
GPU RAM Usage 0
Global Environment variables:
CPAI_APPROOTPATH = <root>
CPAI_PORT = 32168
Installation logs:
<pre>18:06:28:Preparing to install module 'ObjectDetectionCoral'
18:06:28:Downloading module 'ObjectDetectionCoral'
18:06:29:Installing module 'ObjectDetectionCoral'
18:06:29:Installer script at '/app/setup.sh'
18:06:29:ObjectDetectionCoral: Setting verbosity to info
18:06:29:ObjectDetectionCoral: Hi Docker! We will disable shared python installs for downloaded modules
18:06:29:ObjectDetectionCoral: No schemas installed
18:06:29:ObjectDetectionCoral: (No schemas means: we can't detect if you're in light or dark mode)
18:06:29:ObjectDetectionCoral: Installing CodeProject.AI Analysis Module
18:06:29:ObjectDetectionCoral: ======================================================================
18:06:29:ObjectDetectionCoral: CodeProject.AI Installer
18:06:29:ObjectDetectionCoral: ======================================================================
18:06:29:ObjectDetectionCoral: 40.01 GiB of 50.00 GiB available on Docker
18:06:29:ObjectDetectionCoral: os, arch = linux x86_64
18:06:29:ObjectDetectionCoral: systemName, platform = Docker, linux
18:06:29:ObjectDetectionCoral: edgeDevice =
18:06:29:ObjectDetectionCoral: SSH = false
18:06:29:ObjectDetectionCoral: setupMode = SetupModule
18:06:29:ObjectDetectionCoral: executionEnvironment = Production
18:06:29:ObjectDetectionCoral: rootDirPath = /app
18:06:29:ObjectDetectionCoral: appRootDirPath = /app
18:06:29:ObjectDetectionCoral: setupScriptDirPath = /app
18:06:29:ObjectDetectionCoral: sdkScriptsDirPath = /app/SDK/Scripts
18:06:29:ObjectDetectionCoral: runtimesDirPath = /app/runtimes
18:06:29:ObjectDetectionCoral: modulesDirPath = /app/modules
18:06:29:ObjectDetectionCoral: downloadDirPath = /app/downloads
18:06:29:ObjectDetectionCoral: Installing xz-utils...
18:06:29:ObjectDetectionCoral: WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
18:06:29:ObjectDetectionCoral: WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
18:06:30:ObjectDetectionCoral: stty: 'standard input': Inappropriate ioctl for device
18:06:30:ObjectDetectionCoral: General CodeProject.AI setup
18:06:30:ObjectDetectionCoral: Setting permissions on downloads folder...done
18:06:30:ObjectDetectionCoral: Setting permissions on modules download folder...done
18:06:30:ObjectDetectionCoral: Setting permissions on models download folder...done
18:06:30:ObjectDetectionCoral: Setting permissions on runtimes folder...done
18:06:30:ObjectDetectionCoral: Setting permissions on persisted data folder...done
18:06:30:ObjectDetectionCoral: GPU support
18:06:31:ObjectDetectionCoral: CUDA (NVIDIA) Present: No
18:06:31:ObjectDetectionCoral: ROCm (AMD) Present: No
18:06:31:ObjectDetectionCoral: MPS (Apple) Present: No
18:06:31:ObjectDetectionCoral: Reading module settings.......done
18:06:31:ObjectDetectionCoral: Processing module ObjectDetectionCoral 2.2.0
18:06:31:ObjectDetectionCoral: moduleName = Object Detection (Coral)
18:06:31:ObjectDetectionCoral: moduleVersion = 2.2.0
18:06:31:ObjectDetectionCoral: runtime = python3.9
18:06:31:ObjectDetectionCoral: runtimeLocation = Local
18:06:31:ObjectDetectionCoral: installGPU = true
18:06:31:ObjectDetectionCoral: pythonVersion = 3.9
18:06:31:ObjectDetectionCoral: virtualEnvDirPath = /app/modules/ObjectDetectionCoral/bin/linux/python39/venv
18:06:31:ObjectDetectionCoral: venvPythonCmdPath = /app/modules/ObjectDetectionCoral/bin/linux/python39/venv/bin/python3.9
18:06:31:ObjectDetectionCoral: packagesDirPath = /app/modules/ObjectDetectionCoral/bin/linux/python39/venv/lib/python3.9/site-packages/
18:06:31:ObjectDetectionCoral: Installing Python 3.9
18:06:31:ObjectDetectionCoral: Python 3.9 is already installed
18:06:32:ObjectDetectionCoral: W: https://packages.cloud.google.com/apt/dists/coral-edgetpu-stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
18:06:32:ObjectDetectionCoral: Ensuring PIP in base python install...Reading package lists...
18:06:32:ObjectDetectionCoral: Building dependency tree...
18:06:32:ObjectDetectionCoral: Reading state information...
18:06:33:ObjectDetectionCoral: 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 24 not upgraded.
18:06:33:ObjectDetectionCoral: Need to get 193 kB of archives.
18:06:33:ObjectDetectionCoral: After this operation, 0 B of additional disk space will be used.
18:06:33:ObjectDetectionCoral: Get:1 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy/main amd64 python3.9-distutils all 3.9.19-1+jammy1 [193 kB]
18:06:33:ObjectDetectionCoral: debconf: delaying package configuration, since apt-utils is not installed
18:06:33:ObjectDetectionCoral: Fetched 193 kB in 0s (850 kB/s)
18:06:33:ObjectDetectionCoral: (Reading database ...
18:06:33:ObjectDetectionCoral: (Reading database ... 5%
18:06:33:ObjectDetectionCoral: (Reading database ... 10%
18:06:33:ObjectDetectionCoral: (Reading database ... 15%
18:06:33:ObjectDetectionCoral: (Reading database ... 20%
18:06:33:ObjectDetectionCoral: (Reading database ... 25%
18:06:33:ObjectDetectionCoral: (Reading database ... 30%
18:06:33:ObjectDetectionCoral: (Reading database ... 35%
18:06:33:ObjectDetectionCoral: (Reading database ... 40%
18:06:33:ObjectDetectionCoral: (Reading database ... 45%
18:06:33:ObjectDetectionCoral: (Reading database ... 50%
18:06:33:ObjectDetectionCoral: (Reading database ... 55%
18:06:33:ObjectDetectionCoral: (Reading database ... 60%
18:06:33:ObjectDetectionCoral: (Reading database ... 65%
18:06:33:ObjectDetectionCoral: (Reading database ... 70%
18:06:33:ObjectDetectionCoral: (Reading database ... 75%
18:06:33:ObjectDetectionCoral: (Reading database ... 80%
18:06:33:ObjectDetectionCoral: (Reading database ... 85%
18:06:33:ObjectDetectionCoral: (Reading database ... 90%
18:06:33:ObjectDetectionCoral: (Reading database ... 95%
18:06:33:ObjectDetectionCoral: (Reading database ... 100%
18:06:33:ObjectDetectionCoral: (Reading database ... 20873 files and directories currently installed.)
18:06:33:ObjectDetectionCoral: Preparing to unpack .../python3.9-distutils_3.9.19-1+jammy1_all.deb ...
18:06:33:ObjectDetectionCoral: Unpacking python3.9-distutils (3.9.19-1+jammy1) over (3.9.19-1+jammy1) ...
18:06:33:ObjectDetectionCoral: Setting up python3.9-distutils (3.9.19-1+jammy1) ...
18:06:35:ObjectDetectionCoral: Looking in links: /tmp/tmp5jb9pszo
18:06:35:ObjectDetectionCoral: Requirement already satisfied: setuptools in /usr/local/lib/python3.9/dist-packages (69.2.0)
18:06:35:ObjectDetectionCoral: Requirement already satisfied: pip in /usr/local/lib/python3.9/dist-packages (24.0)
18:06:35:ObjectDetectionCoral: WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
18:06:35:ObjectDetectionCoral: done
18:06:36:ObjectDetectionCoral: Upgrading PIP in base python install...Requirement already satisfied: pip in /usr/local/lib/python3.9/dist-packages (24.0)
18:06:36:ObjectDetectionCoral: WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
18:06:36:ObjectDetectionCoral: done
18:06:36:ObjectDetectionCoral: Installing Virtual Environment tools for Linux...
18:06:36:ObjectDetectionCoral: Searching for installed dependencies:
18:06:40:ObjectDetectionCoral: -> python3-pip python3-setuptools python3.9-venv done
18:06:40:ObjectDetectionCoral: All dependencies already installed.
18:06:40:ObjectDetectionCoral: stty: 'standard input': Inappropriate ioctl for device
18:06:43:ObjectDetectionCoral: Creating Virtual Environment (Local)...done
18:06:43:ObjectDetectionCoral: Checking for Python 3.9...(Found Python 3.9.19) All good
18:06:46:ObjectDetectionCoral: Upgrading PIP in virtual environment... done
18:06:48:ObjectDetectionCoral: Installing updated setuptools in venv... done
18:06:48:ObjectDetectionCoral: Searching for installed dependencies:
18:06:49:ObjectDetectionCoral: -> gnupg done
18:06:49:ObjectDetectionCoral: All dependencies already installed.
18:06:49:ObjectDetectionCoral: stty: 'standard input': Inappropriate ioctl for device
18:06:50:ObjectDetectionCoral: Edge TPU library found.
18:06:50:ObjectDetectionCoral: Installing Python packages for Object Detection (Coral)
18:06:50:ObjectDetectionCoral: Installing GPU-enabled libraries: If available
18:06:50:ObjectDetectionCoral: Ensuring PIP is installed and up to date...
18:06:50:ObjectDetectionCoral: Searching for installed dependencies:
18:06:51:ObjectDetectionCoral: -> python3-pip done
18:06:51:ObjectDetectionCoral: All dependencies already installed.
18:06:51:ObjectDetectionCoral: stty: 'standard input': Inappropriate ioctl for device
18:06:51:ObjectDetectionCoral: Ensuring PIP compatibility ...
18:06:53:ObjectDetectionCoral: Looking in links: /tmp/tmp1itjtiri
18:06:53:ObjectDetectionCoral: Requirement already satisfied: setuptools in ./bin/linux/python39/venv/lib/python3.9/site-packages (69.5.1)
18:06:53:ObjectDetectionCoral: Requirement already satisfied: pip in ./bin/linux/python39/venv/lib/python3.9/site-packages (24.0)
18:06:53:ObjectDetectionCoral: Python packages will be specified by requirements.txt
18:06:57:Response timeout. Try increasing the timeout value
18:06:58:ObjectDetectionCoral: - Installing Tensorflow Lite...Installing https://github.com/google-coral/pycoral/releases/download/v2.0.0/tflite_runtime-2.5.0.post1-cp39-cp39-linux_x86_64.whl... (not checked) done
18:07:04:ObjectDetectionCoral: - Installing PyCoral...Checking ...Check done...Installing pycoral~=2.0... (❌ failed check) done
18:07:05:ObjectDetectionCoral: - Installing NumPy, the fundamental package for array computing with Python...Checking ...Check done...Already installed
18:07:05:ObjectDetectionCoral: - Installing Pillow, a Python Image Library...Checking ...Check done...Already installed
18:07:05:ObjectDetectionCoral: Installing Python packages for the CodeProject.AI Server SDK
18:07:05:ObjectDetectionCoral: Ensuring PIP is installed and up to date...
18:07:05:ObjectDetectionCoral: Searching for installed dependencies:
18:07:07:ObjectDetectionCoral: -> python3-pip done
18:07:07:ObjectDetectionCoral: All dependencies already installed.
18:07:07:ObjectDetectionCoral: stty: 'standard input': Inappropriate ioctl for device
18:07:07:ObjectDetectionCoral: Ensuring PIP compatibility ...
18:07:08:ObjectDetectionCoral: Looking in links: /tmp/tmpf7l3fem8
18:07:08:ObjectDetectionCoral: Requirement already satisfied: setuptools in ./bin/linux/python39/venv/lib/python3.9/site-packages (69.5.1)
18:07:08:ObjectDetectionCoral: Requirement already satisfied: pip in ./bin/linux/python39/venv/lib/python3.9/site-packages (24.0)
18:07:08:ObjectDetectionCoral: Python packages will be specified by requirements.txt
18:07:09:ObjectDetectionCoral: - Installing Pillow, a Python Image Library...Checking ...Check done...Already installed
18:07:11:ObjectDetectionCoral: - Installing Charset normalizer...Checking ...Check done...Installing charset-normalizer... (✅ checked) done
18:07:14:ObjectDetectionCoral: - Installing aiohttp, the Async IO HTTP library...Checking ...Check done...Installing aiohttp... (✅ checked) done
18:07:16:ObjectDetectionCoral: - Installing aiofiles, the Async IO Files library...Checking ...Check done...Installing aiofiles... (✅ checked) done
18:07:18:ObjectDetectionCoral: - Installing py-cpuinfo to allow us to query CPU info...Checking ...Check done...Installing py-cpuinfo... (✅ checked) done
18:07:21:ObjectDetectionCoral: - Installing Requests, the HTTP library...Checking ...Check done...Installing requests... (✅ checked) done
18:07:21:ObjectDetectionCoral: Scanning modulesettings for downloadable models...Processing model list
18:07:21:ObjectDetectionCoral: Downloading objectdetection-mobilenet-large-edgetpu.zip to /app/downloads/modules/ObjectDetectionCoral
18:07:21:ObjectDetectionCoral: Extracting to assets in this folder
18:07:22:ObjectDetectionCoral: Downloading MobileNet Large... already exists...Expanding...done.
18:07:22:ObjectDetectionCoral: Moving contents of objectdetection-mobilenet-large-edgetpu.zip to assets...done.
18:07:22:ObjectDetectionCoral: Downloading objectdetection-mobilenet-medium-edgetpu.zip to /app/downloads/modules/ObjectDetectionCoral
18:07:22:ObjectDetectionCoral: Extracting to assets in this folder
18:07:22:ObjectDetectionCoral: Downloading MobileNet Medium... already exists...Expanding...done.
18:07:22:ObjectDetectionCoral: Moving contents of objectdetection-mobilenet-medium-edgetpu.zip to assets...done.
18:07:23:ObjectDetectionCoral: Downloading objectdetection-mobilenet-small-edgetpu.zip to /app/downloads/modules/ObjectDetectionCoral
18:07:23:ObjectDetectionCoral: Extracting to assets in this folder
18:07:23:ObjectDetectionCoral: Downloading MobileNet Small... already exists...Expanding...done.
18:07:23:ObjectDetectionCoral: Moving contents of objectdetection-mobilenet-small-edgetpu.zip to assets...done.
18:07:23:ObjectDetectionCoral: Downloading objectdetection-mobilenet-tiny-edgetpu.zip to /app/downloads/modules/ObjectDetectionCoral
18:07:23:ObjectDetectionCoral: Extracting to assets in this folder
18:07:23:ObjectDetectionCoral: Downloading MobileNet Tiny... already exists...Expanding...done.
18:07:23:ObjectDetectionCoral: Moving contents of objectdetection-mobilenet-tiny-edgetpu.zip to assets...done.
18:07:24:ObjectDetectionCoral: SELF TEST START ======================================================
18:07:51:ObjectDetectionCoral: WARNING:root:Unable to load delegate for TPU usb:0: Failed to load delegate from libedgetpu.so.1
18:07:51:ObjectDetectionCoral: WARNING:root:TPU Exception creating interpreter: usb:0
18:07:51:ObjectDetectionCoral: WARNING:root:No Coral TPUs found or able to be initialized. Using CPU.
18:07:51:ObjectDetectionCoral: WARNING:root:Unable to load delegate for TPU cpu: Failed to load delegate from libedgetpu.so.1
18:07:51:ObjectDetectionCoral: WARNING:root:Unable to create interpreter for CPU using edgeTPU library: cpu
18:08:16:ObjectDetectionCoral: Debug: MODULE_PATH: /app/modules/ObjectDetectionCoral
18:08:16:ObjectDetectionCoral: Debug: MODELS_DIR: /app/modules/ObjectDetectionCoral/assets
18:08:16:ObjectDetectionCoral: Debug: CPAI_CORAL_MODEL_NAME: mobilenet ssd
18:08:16:ObjectDetectionCoral: Debug: MODEL_SIZE: small
18:08:16:ObjectDetectionCoral: Debug: CPU_MODEL_NAME: tf2_ssd_mobilenet_v2_coco17_ptq.tflite
18:08:16:ObjectDetectionCoral: Debug: TPU_MODEL_NAME: tf2_ssd_mobilenet_v2_coco17_ptq_edgetpu.tflite
18:08:16:ObjectDetectionCoral: Info: TPU detected
18:08:16:ObjectDetectionCoral: Info: Attempting multi-TPU initialisation
18:08:16:ObjectDetectionCoral: Info: Failed to init multi-TPU. Falling back to single TPU.
18:08:16:ObjectDetectionCoral: Info: Unable to find or initialise the Coral TPU. Falling back to CPU-only.
18:08:16:ObjectDetectionCoral: Debug: Input details: {'name': 'serving_default_input:0', 'index': 0, 'shape': array([ 1, 300, 300, 3], dtype=int32), 'shape_signature': array([ 1, 300, 300, 3], dtype=int32), 'dtype': , 'quantization': (0.007843137718737125, 127), 'quantization_parameters': {'scales': array([0.00784314], dtype=float32), 'zero_points': array([127], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}
18:08:16:ObjectDetectionCoral: Debug: Output details: {'name': 'StatefulPartitionedCall:3;StatefulPartitionedCall:2;StatefulPartitionedCall:1;StatefulPartitionedCall:02', 'index': 252, 'shape': array([ 1, 20], dtype=int32), 'shape_signature': array([ 1, 20], dtype=int32), 'dtype': , 'quantization': (0.0, 0), 'quantization_parameters': {'scales': array([], dtype=float32), 'zero_points': array([], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}
18:08:16:ObjectDetectionCoral: Info: Using CPU
18:08:16:ObjectDetectionCoral: Info: Self-test for ObjectDetectionCoral. Success: True
|
|
|
|
|
This is correct, only one TPU per process at a time.
|
|
|
|
|
I tried to install the Ubuntu 2.6.2 CPAI application for Linux on my Ubuntu machine.
I had a lot of trouble.
So I thought, why not read the install instructions?
Clicked on the Installing on Linux link on the CPAI homepage.
I got 404
https:
HTTP ERROR 404
Specifically, at the end, I got hung up with the "pushd" and "popd" commands you are supposed to run.
From what I read online, pushd and popd are not commands that can be run from the command line in Linux, they are components of Bash.
Also the software installer in Ubuntu 22.04 does not recognize the deb file as installable. I then tried to install using dpkg -i, and now cannot run it and cannot uninstall it.
Is the 404 for the install on Linux and MacOS link a mistake, or are there problems with the Ubuntu package?
If the latter, might I suggest to take down the link for the package as well.
Thanks.
|
|
|
|
|
It turns out that I cannot run the Docker 2.6.2 container on my Ubuntu machine either.
If I remember correctly, in one of the recent versions the data and configuration directories were moved.
If I run CPAI version 2.6.2 Docker image without the mount commands, these are the directories listed in the server:
09:59:48:Video adapter info:
09:59:48:STARTING CODEPROJECT.AI SERVER
09:59:48:RUNTIMES_PATH = /app/runtimes
09:59:48:PREINSTALLED_MODULES_PATH = /app/preinstalled-modules
09:59:48:DEMO_MODULES_PATH = /app/demos/modules
09:59:48:MODULES_PATH = /app/modules
09:59:48:PYTHON_PATH = /bin/linux/%PYTHON_NAME%/venv/bin/python3
09:59:48:Data Dir = /etc/codeproject/ai
Quite a while ago, I had been using the advanced run command to start the Code Project AI-Server in order to keep the program from starting with the default settings each time it starts.
The advanced run command from the Docker page on the CPAI website is as folows:
docker run --name CodeProject.AI -d -p 32168:32168 \
--mount type=bind,source=/etc/codeproject/ai,target=/etc/codeproject/ai \
--mount type=bind,source=/opt/codeproject/ai,target=/app/modules \
codeproject/ai-server
When I try to run the AI-Server with this run command, I get an error like this:
unable to start the server: an item with the same key has already been added.
So should I be changing the "Targets" to match the directories listed by the program when started without the mount commands?
Thanks again,
Trying to install the Ubuntu application on my machine has seemed to really mess up the CPAI install.
|
|
|
|
|
|
Chris
On the main Code Project page.
In the Guides, Help, FAQ section.
"Installing on Linux" and
"Installing on Mac OS"
Those two links seem to be broken.
404
|
|
|
|
|
Fixed.
cheers
Chris Maunder
|
|
|
|
|
I just started to wonder if you guys were going to drop support for the Ubuntu app.
|
|
|
|
|
After all that pain in setting up my Debian box? No way!
Longer answer: Linux is where I see a lot of AI work being done. It's core to us.
cheers
Chris Maunder
|
|
|
|
|
Maybe I downloaded a corrupt installer zip file.
On my Ubuntu machine, if I right click on the unzipped deb file, Open with other application, Software Install, I get "Loading application details..." for about a half hour.
If I install it using dpkg -i <filename>, it seems to install, but at the end, the "pushd" and "popd" piece, I get "pushd" not found. Maybe have to run in a bash shell, I read that you can't run those from the Ubuntu command line, they are components of bash.
|
|
|
|
|
I finally got the entire install to work.
The key is to run the entire thing as root. I.e. do sudo -i to change to the root user. then do dpkg -i <filename>,
then run the pushd and popd piece as root.
Then you need to run as root systemctl enable codeproject.ai-server reboot the machine and the AI-Server will start and begin installing the modules.
Apparently just running as sudo will not find the bash shell, but it appears when you are running as root.
It says it is still installing YOLOv5.NET. I will see how this goes, and report back.
|
|
|
|
|
Yep, you need to sudo (for now).
YOLO .NET should be good now.
cheers
Chris Maunder
|
|
|
|
|
Wait. now the server shows "Offline"
Stuck while installing YOLOv5.NET.
|
|
|
|
|
Boy, this is fun!
1. Somehow, CPAI is using the old port 5000. Frigate will not start, since it also uses port 5000. So, go to serversettings .json and change the use port 5000 to false. (Sorry don't remember the name). But /etc/codeproject/serversettings.json is an empty file.
So check where is the actual serversettings.json file.
Server version: 2.6.2
System: Linux
Operating System: Linux (Ubuntu 22.04)
CPUs: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz (Intel)
1 CPU x 4 cores. 4 logical processors (x64)
GPU (Primary): HD Graphics 530 (rev 06) (Intel Corporation)
System RAM: 8 GiB
Platform: Linux
BuildConfig: Release
Execution Env: Native
Runtime Env: Production
Runtimes installed:
.NET runtime: 7.0.17
.NET SDK: Not found
Default Python: 3.10.12
Go: Not found
NodeJS: Not found
Rust: Not found
Video adapter info:
HD Graphics 530 (rev 06):
Driver Version
Video Processor
System GPU info:
GPU 3D Usage 0%
GPU RAM Usage 0
Global Environment variables:
CPAI_APPROOTPATH = <root>
CPAI_PORT = 32168
Module 'Object Detection (YOLOv5 6.2)' 1.9.1 (ID: ObjectDetectionYOLOv5-6.2)
Valid: True
Module Path: <root>/modules/ObjectDetectionYOLOv5-6.2
AutoStart: True
Queue: objectdetection_queue
Runtime: python3.8
Runtime Loc: Shared
FilePath: detect_adapter.py
Start pause: 1 sec
Parallelism: 0
LogVerbosity:
Platforms: all,!raspberrypi,!jetson
GPU Libraries: installed if available
GPU Enabled: enabled
Accelerator:
Half Precis.: enable
Environment Variables
APPDIR = <root>/modules/ObjectDetectionYOLOv5-6.2
CUSTOM_MODELS_DIR = <root>/modules/ObjectDetectionYOLOv5-6.2/custom-models
MODELS_DIR = <root>/modules/ObjectDetectionYOLOv5-6.2/assets
MODEL_SIZE = Medium
USE_CUDA = True
YOLOv5_AUTOINSTALL = false
YOLOv5_VERBOSE = false
Status Data:
Started: 16 Apr 2024 8:26:38 AM Central Standard Time
LastSeen: Not seen
Status: Started
Requests: 0 (includes status calls)
Installation Log
2024-04-16 07:51:04: Setting verbosity to quiet
2024-04-16 07:51:05: Installing CodeProject.AI Analysis Module
2024-04-16 07:51:05: ======================================================================
2024-04-16 07:51:05: CodeProject.AI Installer
2024-04-16 07:51:05: ======================================================================
2024-04-16 07:51:05: 514.00 GiB of 843.02 GiB available on linux
2024-04-16 07:51:05: Installing xz-utils...
2024-04-16 07:51:05: WARNING: WARNING: aptapt does not have a stable CLI interface. does not have a stable CLI interface. Use with caution in scripts.Use with caution in scripts.
2024-04-16 07:51:06: stty: 'standard input': Inappropriate ioctl for device
2024-04-16 07:51:06: General CodeProject.AI setup
2024-04-16 07:51:06: Setting permissions on downloads folder...done
2024-04-16 07:51:06: Setting permissions on modules download folder...done
2024-04-16 07:51:06: Setting permissions on models download folder...done
2024-04-16 07:51:06: Setting permissions on runtimes folder...done
2024-04-16 07:51:06: Setting permissions on persisted data folder...done
2024-04-16 07:51:06: GPU support
2024-04-16 07:51:06: CUDA (NVIDIA) Present: No
2024-04-16 07:51:06: ROCm (AMD) Present: No
2024-04-16 07:51:06: MPS (Apple) Present: No
2024-04-16 07:51:06: Reading module settings.......done
2024-04-16 07:51:06: Processing module ObjectDetectionYOLOv5-6.2 1.9.1
2024-04-16 07:51:06: Installing Python 3.8
2024-04-16 07:51:06: Python 3.8 is already installed
2024-04-16 07:51:10: W: https:
2024-04-16 07:51:15: Ensuring PIP in base python install... done
2024-04-16 07:51:16: Upgrading PIP in base python install... done
2024-04-16 07:51:16: Installing Virtual Environment tools for Linux...
2024-04-16 07:51:17: Searching for python3-pip python3-setuptools python3.8...All good.
2024-04-16 07:51:17: stty: 'standard input': Inappropriate ioctl for device
2024-04-16 07:51:21: Creating Virtual Environment (Shared)... done
2024-04-16 07:51:21: Checking for Python 3.8...(Found Python 3.8.19) All good
2024-04-16 07:51:24: Upgrading PIP in virtual environment... done
2024-04-16 07:51:26: Installing updated setuptools in venv... done
2024-04-16 07:51:51: Downloading Standard YOLO models...Expanding... done.
2024-04-16 07:51:51: Moving contents of models-yolo5-pt.zip to assets...done.
2. And like others are seeing, the server keeps going offline. I cannot even use the explorer to test with an image from the TestData.
I will run Find to see if I can find the actual <root> directory (CPAI_APPROOTPATH) on my machine. (Is that a variable in the machine path?)
I have checked to verify that this is not the Docker image that is running. It is not.
|
|
|
|
|
Port 5000: in /server/appsettings.json there's an entry "DisableLegacyPort". Set this to "true" to stop CodeProject.AI trying to use port 5000.
Stop/start. A suggested fix is:
Try editing /etc/systemd/system/codeproject.ai-server.service to replace "Type=notify" with "Type=simple", then run 'systemctl daemon-reload' followed by 'systemctl restart codeproject.ai-server'
cheers
Chris Maunder
|
|
|
|
|
Well; I must be getting confused in my old age.
I had appsettings.json open in VSC with the change, but I didn't save it??? Duh!
Also changing type to simple from notify seems to have corrected the restarting.
I did have to uninstall and reinstall the YOLOv5 6.2 module to get it to work, but both YOLOv5 6.2 and YOLOv5.NET seem to be working now. (at least with testing with the explorer).
I might take a chance and point Blue Iris to it and see what happens.
Thanks for the help with my confusion.
|
|
|
|
|
The latest 2.6.4 Ubuntu now includes that fix
cheers
Chris Maunder
|
|
|
|
|
Well the only serversettings.json file is the empty one that is in /etc/codeproject. Checking for an enviornment variable called CPAI_APPROOT yields nothing. Root directory has nothing of interest.
root@Ubuntu:/# find / -name serversettings.json
/etc/codeproject/ai/serversettings.json
find: ‘/proc/2879/task/2879/net’: Invalid argument
find: ‘/proc/2879/net’: Invalid argument
find: ‘/proc/20008’: No such file or directory
find: ‘/proc/20009’: No such file or directory
find: ‘/proc/20015’: No such file or directory
find: ‘/run/user/1000/gvfs’: Permission denied
find: ‘/run/user/1000/doc’: Permission denied
Taking a break. Done for now.
|
|
|
|
|
We don't display root dir in settings because we ask people to paste them here, which is a bit of a privacy issue if we're inadvertently publishing things others aren't meant to see.
root will be /usr/bin/codeproject.ai-server-x.y.z (version)
cheers
Chris Maunder
|
|
|
|
|
|
Hey,
Platform: Windows
Server Version: 2.6.2
When making a call to "/v1/vision/custom/list" I'm only getting back a 404 result. The reason why I've looked inti it is that AgentDVR uses this endpoint to list available models in it's "Object Detection" dialog.
Is it intentional that this endpoint does no longer exist?
Nils
modified 16-Apr-24 11:59am.
|
|
|
|
|