Skip to content

Installation of Module ALPR failed with error code 1 on new installed CodeProject.AI 2.9.7 in docker on linux, no GPU. #23

@polluxleading

Description

@polluxleading

CodeProject.AI Server info

08:04:05:System:           Docker (404470b034885189950ff99f9ec0be787b12dd28395e51f2671d3135a622036d)
08:04:05:Operating System: Linux (Ubuntu 22.04 Jammy Jellyfish)
08:04:05:CPUs:             Intel(R) Celeron(R) CPU G530 @ 2.40GHz (Intel)
08:04:05:                  1 CPU x 2 cores. 2 logical processors (x64)
08:04:05:System RAM:       8 GiB
08:04:05:Platform:         Linux
08:04:05:BuildConfig:      Release
08:04:05:Execution Env:    Docker
08:04:05:Runtime Env:      Production
08:04:05:Runtimes installed:
08:04:05:  .NET runtime:     9.0.0
08:04:05:  .NET SDK:         Not found
08:04:05:  Default Python:   3.10.12
08:04:05:  Go:               Not found
08:04:05:  NodeJS:           Not found
08:04:05:  Rust:             Not found
08:04:05:App DataDir:      /etc/codeproject/ai
08:04:05:Video adapter info:
08:04:05:STARTING CODEPROJECT.AI SERVER
08:04:05:RUNTIMES_PATH             = /app/runtimes
08:04:05:PREINSTALLED_MODULES_PATH = /app/preinstalled-modules
08:04:05:DEMO_MODULES_PATH         = /app/src/demos/modules
08:04:05:EXTERNAL_MODULES_PATH     = /CodeProject.AI-Modules
08:04:05:MODULES_PATH              = /app/modules
08:04:05:PYTHON_PATH               = /bin/ubuntu/%PYTHON_NAME%/venv/bin/python3
08:04:05:Data Dir                  = /etc/codeproject/ai
08:04:05:Server version:   2.9.7
08:04:06:Overriding address(es) 'http://+:32168, http://+:5000'. Binding to endpoints defined via IConfiguration and/or UseKestrel() instead.
08:04:09:
08:04:09:Module 'Face Processing' 1.12.3 (ID: FaceProcessing)
08:04:09:Valid:            True
08:04:09:Module Path:      <root>/preinstalled-modules/FaceProcessing
08:04:09:Module Location:  PreInstalled
08:04:09:AutoStart:        True
08:04:09:Queue:            faceprocessing_queue
08:04:09:Runtime:          python3.8
08:04:09:Runtime Location: System
08:04:09:FilePath:         intelligencelayer/face.py
08:04:09:Start pause:      3 sec
08:04:09:Parallelism:      0
08:04:09:LogVerbosity:
08:04:09:Platforms:        all,!jetson
08:04:09:GPU Libraries:    installed if available
08:04:09:GPU:              use if supported
08:04:09:Accelerator:
08:04:09:Half Precision:   enable
08:04:09:Environment Variables
08:04:09:APPDIR             = <root>/preinstalled-modules/FaceProcessing/intelligencelayer
08:04:09:DATA_DIR           = /etc/codeproject/ai
08:04:09:MODE               = MEDIUM
08:04:09:MODELS_DIR         = <root>/preinstalled-modules/FaceProcessing/assets
08:04:09:PROFILE            = desktop_gpu
08:04:09:USE_CUDA           = True
08:04:09:YOLOv5_AUTOINSTALL = false
08:04:09:YOLOv5_VERBOSE     = false
08:04:09:
08:04:09:Started Face Processing module
08:04:11:Server: This is a new, unreleased version
08:04:12:
08:04:12:Module 'Object Detection (YOLOv5 6.2)' 1.10.0 (ID: ObjectDetectionYOLOv5-6.2)
08:04:12:Valid:            True
08:04:12:Module Path:      <root>/preinstalled-modules/ObjectDetectionYOLOv5-6.2
08:04:12:Module Location:  PreInstalled
08:04:12:AutoStart:        True
08:04:12:Queue:            objectdetection_queue
08:04:12:Runtime:          python3.8
08:04:12:Runtime Location: System
08:04:12:FilePath:         detect_adapter.py
08:04:12:Start pause:      1 sec
08:04:12:Parallelism:      0
08:04:12:LogVerbosity:
08:04:12:Platforms:        all,!raspberrypi,!orangepi,!jetson,!radxarock
08:04:12:GPU Libraries:    installed if available
08:04:12:GPU:              use if supported
08:04:12:Accelerator:
08:04:12:Half Precision:   enable
08:04:12:Environment Variables
08:04:12:APPDIR             = <root>/preinstalled-modules/ObjectDetectionYOLOv5-6.2
08:04:12:CUSTOM_MODELS_DIR  = <root>/preinstalled-modules/ObjectDetectionYOLOv5-6.2/custom-models
08:04:12:MODELS_DIR         = <root>/preinstalled-modules/ObjectDetectionYOLOv5-6.2/assets
08:04:12:MODEL_SIZE         = Medium
08:04:12:USE_CUDA           = True
08:04:12:YOLOv5_AUTOINSTALL = false
08:04:12:YOLOv5_VERBOSE     = false
08:04:12:
08:04:12:Started Object Detection (YOLOv5 6.2) module

If you use Docker
Docker launch with settings saved outside of the container.

docker run --name CodeProject.AI -d -p 32168:32168 \
 --mount type=bind,source=/docker/codeproject/settings,target=/etc/codeproject/ai \
 --mount type=bind,source=/docker/codeproject/modules,target=/app/modules \
   codeproject/ai-server

Describe the bug
Installation of Module ALPR failed with error code 1.

In the log it looks for me, like the Applying PaddleOCR patch failes. Is there a typo in the directoy path? "(...)site-packages//paddleocr(...)" Shouldn't htere only be one "/" instead of two "//"?

Afterwards it says: No such file or directory

Image

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Install Modules'
  2. Do not use download cache ACTIVATED
  3. Install verbosity QUIET (default), If wished I can also change to INFO or LOUD and post the logs.
  4. Click in the line of 'License Plate Reader 3.3.4 2024-12-11 Available' on the Button 'Install'.
  5. Switch to Tab 'Server logs'.
  6. See errorExpected behaviorA clear and concise description of what you expected to happen. Installation should run smoothly and install all required and depending packages.
  7. But it states "Module ALPR installed successfully." but at the startup of the module it states "ALPR_adapter.py: Using PIL for image manipulation (Either OpenCV or numpy not available for this module)" and a few tracebacks, including "ALPR_adapter.py: ModuleNotFoundError: No module named 'cv2'" and then "Module ALPR has shutdown" but then message "ALPR_adapter.py: has exited" and "Module ALPR started successfully." But in the Tab 'Status' the line of License Plate Reader 3.3.4 is red with 'Failed to start'.

Screenshots

Image

Server logs

Server Start

08:04:05:System:           Docker (404470b034885189950ff99f9ec0be787b12dd28395e51f2671d3135a622036d)
08:04:05:Operating System: Linux (Ubuntu 22.04 Jammy Jellyfish)
08:04:05:CPUs:             Intel(R) Celeron(R) CPU G530 @ 2.40GHz (Intel)
08:04:05:                  1 CPU x 2 cores. 2 logical processors (x64)
08:04:05:System RAM:       8 GiB
08:04:05:Platform:         Linux
08:04:05:BuildConfig:      Release
08:04:05:Execution Env:    Docker
08:04:05:Runtime Env:      Production
08:04:05:Runtimes installed:
08:04:05:  .NET runtime:     9.0.0
08:04:05:  .NET SDK:         Not found
08:04:05:  Default Python:   3.10.12
08:04:05:  Go:               Not found
08:04:05:  NodeJS:           Not found
08:04:05:  Rust:             Not found
08:04:05:App DataDir:      /etc/codeproject/ai
08:04:05:Video adapter info:
08:04:05:STARTING CODEPROJECT.AI SERVER
08:04:05:RUNTIMES_PATH             = /app/runtimes
08:04:05:PREINSTALLED_MODULES_PATH = /app/preinstalled-modules
08:04:05:DEMO_MODULES_PATH         = /app/src/demos/modules
08:04:05:EXTERNAL_MODULES_PATH     = /CodeProject.AI-Modules
08:04:05:MODULES_PATH              = /app/modules
08:04:05:PYTHON_PATH               = /bin/ubuntu/%PYTHON_NAME%/venv/bin/python3
08:04:05:Data Dir                  = /etc/codeproject/ai
08:04:05:Server version:   2.9.7
08:04:06:Overriding address(es) 'http://+:32168, http://+:5000'. Binding to endpoints defined via IConfiguration and/or UseKestrel() instead.
08:04:09:
08:04:09:Module 'Face Processing' 1.12.3 (ID: FaceProcessing)
08:04:09:Valid:            True
08:04:09:Module Path:      <root>/preinstalled-modules/FaceProcessing
08:04:09:Module Location:  PreInstalled
08:04:09:AutoStart:        True
08:04:09:Queue:            faceprocessing_queue
08:04:09:Runtime:          python3.8
08:04:09:Runtime Location: System
08:04:09:FilePath:         intelligencelayer/face.py
08:04:09:Start pause:      3 sec
08:04:09:Parallelism:      0
08:04:09:LogVerbosity:
08:04:09:Platforms:        all,!jetson
08:04:09:GPU Libraries:    installed if available
08:04:09:GPU:              use if supported
08:04:09:Accelerator:
08:04:09:Half Precision:   enable
08:04:09:Environment Variables
08:04:09:APPDIR             = <root>/preinstalled-modules/FaceProcessing/intelligencelayer
08:04:09:DATA_DIR           = /etc/codeproject/ai
08:04:09:MODE               = MEDIUM
08:04:09:MODELS_DIR         = <root>/preinstalled-modules/FaceProcessing/assets
08:04:09:PROFILE            = desktop_gpu
08:04:09:USE_CUDA           = True
08:04:09:YOLOv5_AUTOINSTALL = false
08:04:09:YOLOv5_VERBOSE     = false
08:04:09:
08:04:09:Started Face Processing module
08:04:11:Server: This is a new, unreleased version
08:04:12:
08:04:12:Module 'Object Detection (YOLOv5 6.2)' 1.10.0 (ID: ObjectDetectionYOLOv5-6.2)
08:04:12:Valid:            True
08:04:12:Module Path:      <root>/preinstalled-modules/ObjectDetectionYOLOv5-6.2
08:04:12:Module Location:  PreInstalled
08:04:12:AutoStart:        True
08:04:12:Queue:            objectdetection_queue
08:04:12:Runtime:          python3.8
08:04:12:Runtime Location: System
08:04:12:FilePath:         detect_adapter.py
08:04:12:Start pause:      1 sec
08:04:12:Parallelism:      0
08:04:12:LogVerbosity:
08:04:12:Platforms:        all,!raspberrypi,!orangepi,!jetson,!radxarock
08:04:12:GPU Libraries:    installed if available
08:04:12:GPU:              use if supported
08:04:12:Accelerator:
08:04:12:Half Precision:   enable
08:04:12:Environment Variables
08:04:12:APPDIR             = <root>/preinstalled-modules/ObjectDetectionYOLOv5-6.2
08:04:12:CUSTOM_MODELS_DIR  = <root>/preinstalled-modules/ObjectDetectionYOLOv5-6.2/custom-models
08:04:12:MODELS_DIR         = <root>/preinstalled-modules/ObjectDetectionYOLOv5-6.2/assets
08:04:12:MODEL_SIZE         = Medium
08:04:12:USE_CUDA           = True
08:04:12:YOLOv5_AUTOINSTALL = false
08:04:12:YOLOv5_VERBOSE     = false
08:04:12:
08:04:12:Started Object Detection (YOLOv5 6.2) module

================================================================

Install Module

08:09:14:Call to run Install on module ALPR has completed.
08:09:14:Preparing to install module 'ALPR'
08:09:14:Downloading module 'ALPR'
08:09:15:Installing module 'ALPR'
08:09:15:ALPR: Setting verbosity to quiet
08:09:15:ALPR: Hi Docker! We will disable shared python installs for downloaded modules
08:09:15:ALPR: (No schemas means: we can't detect if you're in light or dark mode)
08:09:15:ALPR:              Installing CodeProject.AI Analysis Module                
08:09:15:ALPR: ======================================================================
08:09:15:ALPR:                    CodeProject.AI Installer                           
08:09:15:ALPR: ======================================================================
08:09:15:ALPR: 334.07 GiB of 2.04 TiB available on Docker (linux ubuntu x86_64 - linux)
08:09:15:ALPR: Installing xz-utils...
08:09:19:ALPR: E: Could not get lock /var/lib/apt/lists/lock. It is held by process 753 (apt-get)
08:09:19:ALPR: E: Unable to lock directory /var/lib/apt/lists/
08:09:21:ALPR: Reading package lists...
08:09:22:ALPR: Building dependency tree...
08:09:22:ALPR: Reading state information...
08:09:22:ALPR: 0 upgraded, 0 newly installed, 0 to remove and 147 not upgraded.
08:09:23:ALPR: General CodeProject.AI setup                                          
08:09:23:ALPR: Setting permissions on runtimes folder...done
08:09:23:ALPR: Setting permissions on general downloads folder...done
08:09:23:ALPR: Creating module asset downloads folder...done
08:09:23:ALPR: Setting permissions on module asset downloads folder...done
08:09:23:ALPR: Setting permissions on modules folder...done
08:09:23:ALPR: Creating models folder...done
08:09:23:ALPR: Setting permissions on models folder...done
08:09:23:ALPR: Setting permissions on persisted data folder...done
08:09:23:ALPR: GPU support                                                           
08:09:23:ALPR: CUDA (NVIDIA) Present: No
08:09:35:ALPR: ROCm (AMD) Present:    (attempt to install rocminfo... ) No
08:09:35:ALPR: MPS (Apple) Present:   No
08:09:36:ALPR: Reading module settings.......done
08:09:36:ALPR: Processing module ALPR 3.3.4 (Internal)                               
08:09:36:ALPR: Installing Python 3.8
08:09:36:ALPR: Python 3.8 is already installed
08:09:48:ALPR: Ensuring PIP in base python install...  done
08:09:53:ALPR: Upgrading PIP in base python install... done
08:09:53:ALPR: Installing Virtual Environment tools for Linux...
08:10:17:ALPR: Searching for python3-pip python3-setuptools python3.8...installing...   done
08:10:23:ALPR: Creating Virtual Environment (Local)... done
08:10:23:ALPR: Checking for Python 3.8...(Found Python 3.8.20) All good
08:10:27:ALPR: Upgrading PIP in virtual environment... done
08:10:30:ALPR: Installing updated setuptools in venv... done
08:10:30:ALPR: deb http://security.ubuntu.com/ubuntu focal-security main
08:10:43:ALPR: Searching for libssl1.1...installing...   done
08:10:43:ALPR: Ensuring symlinks are created...Done
08:10:44:ALPR: Downloading OCR models...Expanding... done.
08:10:44:ALPR: Moving contents of ocr-en-pp_ocrv4-paddle.zip to paddleocr...done.
08:10:44:ALPR: Installing Python packages for License Plate Reader
08:10:44:ALPR: Installing GPU-enabled libraries: No
08:10:47:ALPR: Searching for python3-pip...All good.
08:10:49:ALPR: Ensuring PIP compatibility... done
08:10:49:ALPR: Python packages will be specified by requirements.linux.txt
08:10:56:ALPR:   - Installing NumPy, a package for scientific computing... (✅ checked) done
08:10:58:ALPR:   - Installing PaddelPaddle, the Deep Learning platform... (❌ failed check) done
08:12:21:ALPR:   - Installing PaddleOCR, the OCR toolkit based on PaddlePaddle... (❌ failed check) done
08:12:27:ALPR:   - Installing imutils, the image utilities library... (✅ checked) done
08:12:55:ALPR:   - Installing the CodeProject.AI SDK... (✅ checked) done
08:12:55:ALPR: Scanning modulesettings for downloadable models...No models specified
08:12:55:ALPR: Executing post-install script for License Plate Reader
08:12:55:ALPR: Applying PaddleOCR patch
08:12:55:ALPR: cp: cannot create regular file '/app/modules/ALPR/bin/ubuntu/python38/venv/lib/python3.8/site-packages//paddleocr/.': No such file or directory
08:12:55:ALPR: Module setup time 00:03:19
08:12:55:ALPR: Install failed: Error running post-install script
08:12:55:ALPR:                 Setup complete                                        
08:12:55:ALPR: Total setup time 00:03:40
08:12:55:ALPR: SETUP FAILED:
08:12:55:ALPR:  - [Int: ALPR] Error running post-install script
08:12:56:Module ALPR installed successfully.
08:12:56:Installer exited with code 1
08:12:56:
08:12:56:Module 'License Plate Reader' 3.3.4 (ID: ALPR)
08:12:56:Valid:            True
08:12:56:Module Path:      <root>/modules/ALPR
08:12:56:Module Location:  Internal
08:12:56:AutoStart:        True
08:12:56:Queue:            alpr_queue
08:12:56:Runtime:          python3.8
08:12:56:Runtime Location: Local
08:12:56:FilePath:         ALPR_adapter.py
08:12:56:Start pause:      3 sec
08:12:56:Parallelism:      0
08:12:56:LogVerbosity:
08:12:56:Platforms:        all,!windows-arm64
08:12:56:GPU Libraries:    not installed
08:12:56:GPU:              do not use
08:12:56:Accelerator:
08:12:56:Half Precision:   enable
08:12:56:Environment Variables
08:12:56:AUTO_PLATE_ROTATE            = True
08:12:56:CROPPED_PLATE_DIR            = <root>/Server/wwwroot
08:12:56:MIN_COMPUTE_CAPABILITY       = 6
08:12:56:MIN_CUDNN_VERSION            = 7
08:12:56:OCR_OPTIMAL_CHARACTER_HEIGHT = 60
08:12:56:OCR_OPTIMAL_CHARACTER_WIDTH  = 30
08:12:56:OCR_OPTIMIZATION             = True
08:12:56:PLATE_CONFIDENCE             = 0.7
08:12:56:PLATE_RESCALE_FACTOR         = 2
08:12:56:PLATE_ROTATE_DEG             = 0
08:12:56:REMOVE_SPACES                = False
08:12:56:ROOT_PATH                    = <root>
08:12:56:SAVE_CROPPED_PLATE           = False
08:12:56:
08:12:56:Started License Plate Reader module
08:12:56:ALPR_adapter.py: Using PIL for image manipulation (Either OpenCV or numpy not available for this module)
08:12:56:ALPR_adapter.py: Traceback (most recent call last):
08:12:56:ALPR_adapter.py:   File "/app/modules/ALPR/ALPR_adapter.py", line 11, in 
08:12:56:ALPR_adapter.py:     from ALPR import init_detect_platenumber, detect_platenumber
08:12:56:ALPR_adapter.py:   File "/app/modules/ALPR/ALPR.py", line 7, in 
08:12:56:ALPR_adapter.py:     import utils.tools as tool
08:12:56:ALPR_adapter.py:   File "/app/modules/ALPR/utils/tools.py", line 2, in 
08:12:56:ALPR_adapter.py:     import cv2
08:12:56:ALPR_adapter.py: ModuleNotFoundError: No module named 'cv2'
08:12:56:Module ALPR has shutdown
08:12:56:ALPR_adapter.py: has exited
08:12:59:Module ALPR started successfully.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions