Click here to Skip to main content
15,917,652 members
Articles / Artificial Intelligence

Running CodeProject.AI Server on a Raspberry Pi

Rate me:
Please Sign up or sign in to vote.
5.00/5 (5 votes)
10 Aug 2023CPOL4 min read 14.8K   11   5
Building, running and debugging CodeProject.AI Server on a Raspberry Pi
This article explains how to set up a Raspberry Pi with a 64-bit operating system, install Visual Studio Code, and run CodeProject.AI Server for debugging a .NET 7 app with Python modules running AI inference on the Raspberry Pi.

This is for those brave enough to run the code directly from VS Code. If you want to simply use your RPi with a Coral stick without the fuss, check out the Raspberry Pi (Arm64) tab in our Docker documentation to use CodeProject.AI Server in a docker image on Raspberry Pi with Coral.

A Raspberry Pi is a very, very modest little computer. It has a quad-core Arm64 CPU running at 1.8GHz, 4Gb DDR4 RAM, Bluetooth, Wi-Fi, some ports and not a lot else. It's cheap, it's tiny, and it can run Visual Studio Code debugging a .NET 7 app that's spawned half a dozen Python modules running AI inference.

Let's walk through this.

Step 1: Upgrade to a 64 bit Operating System

My Raspberry Pi 400 initially came with the 32bit OS for reasons unknown to me. Let's fix this by heading to the Raspberry Pi site and grabbing the imager.

To use the imager, make sure you have a microSD card connected to your machine. I initially chose a 1Tb SD card ($30!) to ensure everything would fit, but that seemed to cause issues with the imager. Formatting the card prior to using the imager didn't help, so I switched to a more modest (and more reputably branded) 128Gb card.

Image 1

Image 2

Once you have run the image to install the new 64bit OS on the card, insert it into your Raspberry Pi and power up.

Step 2: Visual Studio Code

This is the easy one, thanks to Microsoft. Open a terminal window on the Pi and type:

Bash
sudo apt update
sudo apt install code

Launch VS Code, sign in, sync your settings and set it up just so and you are good to go. VS Code on a Raspberry Pi is a testament to both the power of the Raspberry Pi and the efficiency of VS Code.

Step 3: CodeProject.AI Server

In VS Code, clone the CodeProject.AI Server repository as you would normally. Make sure you have enough room on your Raspberry Pi's SD card. A few Gb should be plenty.

Once you've pulled the repo, you will need to set things up. Again, this is straightforward.

Open a new terminal and head to the /src folder in the repo. The easiest way is via Terminal menu in VS Code: choose 'New Terminal', then within the terminal window just 'cd src' and you're there. Alternatively, open a terminal from the Raspberry Pi System menu, and head to the /src directory in the CodeProject.AI Server repository.

Once there, run

Bash
bash setup.sh

Image 3

The Runtimes

The setup script is generally fast except for the excruciatingly slow process of the initial installation of Python 3.7. The Raspberry Pi's come with Python 3.9 installed, but for 3.7, you will need to compile from source. Thankfully Theo van der Sluijs has created a script that handles this for us. It took nearly an hour for it to complete on my Pi, with the vast majority of the time was spent running the regression tests.

After Python comes .NET 7, which is handled by another script, thanks to Pete Gallaghar.

Don't worry - you don't need to download anything: the setup.sh script has everything you need and will do this for you.

The Modules

Once the runtimes are setup, the module installation is the same as any other platform. Just let the scripts do its thing. The Python virtual environments will be setup for each module that requires one, and the models that each module will run will be downloaded and placed in the correct location.

Building and Debugging

Once the setup script has been run, it's time to build and launch. Again, this is a bit of a non-event because you just go to the Run and Debug panel in VS Code and choose Build All & Launch Server Arm64 from the dropdown.

Image 4

We have separate x64 and Arm64 builds because some modules, such as PortraitFilter, which use Microsoft.ML.OnnxRuntime aren't supported in Arm64 and so need to be excluded from the Arm64 build.

Clicking the arrow next to the dropdown will launch the server. You can debug and step through the server code on a Raspberry Pi just like any other VS Code installation. On launch, the same dashboard UI appears, and you can open the same explorer experience.

Image 5

Again, we need to remember that this is a tiny computer with a very limited amount of RAM. I tend to use the smallest models that a given module will allow me to use, but even then, inference times can be over a second.

Image 6

Improving Performance

The next step in developing for the Raspberry Pi will be tackled using three approaches:

  1. Sourcing new modules that are faster, leaner, and more tuned to a resource limited environment like a Pi
  2. Providing smaller and leaner models
  3. Providing support for external AI accelerators such as the Coral AI USB stick

For now, though, we have the ability to debug issues with Python packages, .NET installs, server quirks, hardware reporting and our setup scripts natively on the Pi. This makes targeting the Raspberry Pi exceptionally easy, as long as one is patient.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder CodeProject
Canada Canada
Chris Maunder is the co-founder of CodeProject and ContentLab.com, and has been a prominent figure in the software development community for nearly 30 years. Hailing from Australia, Chris has a background in Mathematics, Astrophysics, Environmental Engineering and Defence Research. His programming endeavours span everything from FORTRAN on Super Computers, C++/MFC on Windows, through to to high-load .NET web applications and Python AI applications on everything from macOS to a Raspberry Pi. Chris is a full-stack developer who is as comfortable with SQL as he is with CSS.

In the late 1990s, he and his business partner David Cunningham recognized the need for a platform that would facilitate knowledge-sharing among developers, leading to the establishment of CodeProject.com in 1999. Chris's expertise in programming and his passion for fostering a collaborative environment have played a pivotal role in the success of CodeProject.com. Over the years, the website has grown into a vibrant community where programmers worldwide can connect, exchange ideas, and find solutions to coding challenges. Chris is a prolific contributor to the developer community through his articles and tutorials, and his latest passion project, CodeProject.AI.

In addition to his work with CodeProject.com, Chris co-founded ContentLab and DeveloperMedia, two projects focussed on helping companies make their Software Projects a success. Chris's roles included Product Development, Content Creation, Client Satisfaction and Systems Automation.

Comments and Discussions

 
QuestionServer Pin
Frank Ingendahl2-Nov-23 1:12
Frank Ingendahl2-Nov-23 1:12 
AnswerRe: Server Pin
Chris Maunder2-Nov-23 3:19
cofounderChris Maunder2-Nov-23 3:19 
GeneralRe: Server Pin
Frank Ingendahl3-Nov-23 6:56
Frank Ingendahl3-Nov-23 6:56 
GeneralRe: Server Pin
Frank Ingendahl3-Nov-23 7:39
Frank Ingendahl3-Nov-23 7:39 
I think the whole script needs to be revised?
My hardware Raspberry Pi 4 8GB

pi@IspyAgent:~ $ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
pi@IspyAgent:~ $ 

pi@IspyAgent:~ $ bash /usr/bin/codeproject.ai-server/start.sh
bash: /usr/bin/codeproject.ai-server/start.sh: No such file or directory
pi@IspyAgent:~ $ 

pi@IspyAgent:~ $ cd /home/pi/Downloads/CodeProject.AI-Server-main/src/
pi@IspyAgent:~/Downloads/CodeProject.AI-Server-main/src $ sudo bash setup.sh

          Setting up CodeProject.AI Development Environment           

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

                   CodeProject.AI Installer                           

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

64.01 GiB  available

Checking GPU support                                                  

CUDA Present...No
Allowing GPU Support: Yes
Allowing CUDA Support: Yes

General CodeProject.AI setup                                          

Setting permissions...Done

Processing SDK                                                        

Adding toolchain repo...Done
Checking for installed dependencies (from gcc-4.9 apt-utils)...Done
Installing missing dependencies: gcc-4.9...E: Unable to locate package gcc-4.9
E: Couldn't find any package by glob 'gcc-4.9'
E: Couldn't find any package by regex 'gcc-4.9'
Done
Upgrading libstdc...Done
Checking for installed dependencies (from  ca-certificates gnupg libc6-dev libfontconfig1 libgdiplus libjpeg-dev zlib1g-dev)...Done
All dependencies already installed.
Checking for installed dependencies (from ffmpeg libsm6 libxext6 mesa-utils curl rsync unzip wget)...Done
All dependencies already installed.
Checking for .NET >= 7.0...All good. Current .NET is 7.0.403, requested was 7.0

Processing module ALPR 2.6                                            

Unable to install PaddleOCR on Raspberry Pi, Orange Pi or Jetson. Quitting.

Processing module BackgroundRemover 1.5                               

Python 3.9 is already installed
Virtual Environment already present
Checking for Python 3.9...Found Python 3.9.2. present
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
Installing setuptools...Done
Choosing packages from requirements.linux.txt
  - Installing the ONNX runtime....Already installed
  - Installing FileType, a package to infer file types and MIME types...Already installed
  - Installing gdown, a package for downloading from Google Drive folders...Already installed
  - Installing NumPy, a package for scientific computing...Already installed
  - Installing pymatting, a Python Library for Alpha Matting...Already installed
  - Installing Pillow, a Python Image Library...Already installed
  - Installing FlatBuffers serialization format support...Already installed
Downloading Background Remover models... already exists...Expanding...Done.
Installing Server SDK support:
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
Installing setuptools...Done
Choosing packages from requirements.txt
  - Installing Charset normalizer...Already installed
  - Installing aiohttp, the Async IO HTTP library...Already installed
  - Installing aiofiles, the Async IO Files library...Already installed
  - Installing py-cpuinfo to allow us to query CPU info...Already installed
  - Installing Requests, the HTTP library...Already installed
  - Installing Pillow, a Python Image Library...Already installed

Processing module Cartooniser 1.2                                     

Python 3.9 is already installed
Virtual Environment already present
Checking for Python 3.9...Found Python 3.9.2. present
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
Installing setuptools...Done
Choosing packages from requirements.gpu.txt
  - Installing PyTorch, for Tensor computation and Deep neural networks...Already installed
  - Installing TorchVision, for Computer Vision based AI...Already installed
  - Installing Pillow, a Python Image Library...Already installed
Downloading Cartooniser models... already exists...Expanding...Done.
Installing Server SDK support:
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
Installing setuptools...Done
Choosing packages from requirements.txt
  - Installing Charset normalizer...Already installed
  - Installing aiohttp, the Async IO HTTP library...Already installed
  - Installing aiofiles, the Async IO Files library...Already installed
  - Installing py-cpuinfo to allow us to query CPU info...Already installed
  - Installing Requests, the HTTP library...Already installed
  - Installing Pillow, a Python Image Library...Already installed

Processing module FaceProcessing 1.7                                  

Python 3.7 is already installed
Virtual Environment already present
Checking for Python 3.7...Found Python 3.7.9. present
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
Installing setuptools...Done
Choosing packages from requirements.linux.arm64.txt
  - Installing Pandas, a data analysis / data manipulation tool...Already installed
  - Installing CoreMLTools, for working with .mlmodel format models...Already installed
  - Installing OpenCV, the Open source Computer Vision library...Already installed
  - Installing Pillow, a Python Image Library...Already installed
  - Installing SciPy, a library for mathematics, science, and engineering...Already installed
  - Installing PyYAML, a library for reading configuration files...Already installed
  - Installing Torch, for Tensor computation and Deep neural networks...Already installed
  - Installing TorchVision, for Computer Vision based AI...Already installed
  - Installing Seaborn, a data visualization library based on matplotlib...Already installed
Downloading YOLO models... already exists...Expanding...Done.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
sqlite3 is already the newest version (3.34.1-3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Installing Server SDK support:
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
Installing setuptools...Done
Choosing packages from requirements.txt
  - Installing Charset normalizer...Already installed
  - Installing aiohttp, the Async IO HTTP library...Already installed
  - Installing aiofiles, the Async IO Files library...Already installed
  - Installing py-cpuinfo to allow us to query CPU info...Already installed
  - Installing Requests, the HTTP library...Already installed
  - Installing Pillow, a Python Image Library...Already installed

Processing module ObjectDetectionCoral 1.5.1                          

Python 3.9 is already installed
Virtual Environment already present
Checking for Python 3.9...Found Python 3.9.2. present
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
Installing setuptools...Done
Choosing packages from requirements.linux.arm64.txt
  - Installing Tensorflow Lite...(not checked) Done
  - Installing NumPy, the fundamental package for array computing with Python....Already installed
  - Installing Pillow, a Python Image Library...Already installed
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package cython is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'cython' has no installation candidate
deb https://packages.cloud.google.com/apt coral-edgetpu-stable main
Downloading signing keys...Done
Installing signing keys...Done
Installing libedgetpu1-std (the non-desk-melting version of libedgetpu1)...Done
Downloading MobileNet models... already exists...Expanding...Done.
Installing Server SDK support:
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
Installing setuptools...Done
Choosing packages from requirements.txt
  - Installing Charset normalizer...Already installed
  - Installing aiohttp, the Async IO HTTP library...Already installed
  - Installing aiofiles, the Async IO Files library...Already installed
  - Installing py-cpuinfo to allow us to query CPU info...Already installed
  - Installing Requests, the HTTP library...Already installed
  - Installing Pillow, a Python Image Library...Already installed

Processing module ObjectDetectionNet 1.6                              

Downloading Nuget packages... already exists...Expanding...Done.
Downloading YOLO ONNX models... already exists...Expanding...Done.
Downloading Custom YOLO ONNX models... already exists...Expanding...Done.

Processing module ObjectDetectionYolo 1.6.1                           

Python 3.8 is already installed
Installing Virtual Environment tools for Linux...Done
Creating Virtual Environment (Shared)...Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python3.8'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python3.8'
  sys.base_prefix = '/usr'
  sys.base_exec_prefix = '/usr'
  sys.executable = '/usr/bin/python3.8'
  sys.prefix = '/usr'
  sys.exec_prefix = '/usr'
  sys.path = [
    '/usr/lib/python38.zip',
    '/usr/lib/python3.8',
    '/usr/lib/python3.8/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x0000007f84551780 (most recent call first):
<no Python frame>
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1145: pushd: /home/pi/Downloads/CodeProject.AI-Server-main/src/runtimes/bin/linux/python38/venv/bin: No such file or directory
Installing setuptools...Done
Choosing packages from requirements.linux.arm64.txt
  - Installing Pandas, a data analysis / data manipulation tool...(failed check) Done
  - Installing CoreMLTools, for working with .mlmodel format models...(failed check) Done
  - Installing OpenCV, the Open source Computer Vision library...(failed check) Done
  - Installing Pillow, a Python Image Library...(failed check) Done
  - Installing SciPy, a library for mathematics, science, and engineering...(failed check) Done
  - Installing PyYAML, a library for reading configuration files...(failed check) Done
  - Installing Torch, for Tensor computation and Deep neural networks...(failed check) Done
  - Installing TorchVision, for Computer Vision based AI...(failed check) Done
  - Installing Ultralytics YoloV5 package for object detection in images...(failed check) Done
  - Installing Seaborn, a data visualization library based on matplotlib...(failed check) Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1267: popd: directory stack empty

Downloading Standard YOLO models... already exists...Expanding...Done.
Downloading Custom YOLO models... already exists...Expanding...Done.
Installing Server SDK support:
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1145: pushd: /home/pi/Downloads/CodeProject.AI-Server-main/src/runtimes/bin/linux/python38/venv/bin: No such file or directory
Installing setuptools...Done
Choosing packages from requirements.txt
  - Installing Charset normalizer...(failed check) Done
  - Installing aiohttp, the Async IO HTTP library...(failed check) Done
  - Installing aiofiles, the Async IO Files library...(failed check) Done
  - Installing py-cpuinfo to allow us to query CPU info...(failed check) Done
  - Installing Requests, the HTTP library...(failed check) Done
  - Installing Pillow, a Python Image Library...(failed check) Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1267: popd: directory stack empty

Processing module ObjectDetectionYoloRKNN 1.3                         

ObjectDetection (Fast Deploy RKNN) can only be installed on Orange Pi devices

Processing module OCR 1.5                                             

Unable to install PaddleOCR on Raspberry Pi, Orange Pi or Jetson. Quitting.

Processing module PortraitFilter 1.4                                  


Processing module SceneClassifier 1.4                                 

Python 3.8 is already installed
Installing Virtual Environment tools for Linux...Done
Creating Virtual Environment (Shared)...Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python3.8'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python3.8'
  sys.base_prefix = '/usr'
  sys.base_exec_prefix = '/usr'
  sys.executable = '/usr/bin/python3.8'
  sys.prefix = '/usr'
  sys.exec_prefix = '/usr'
  sys.path = [
    '/usr/lib/python38.zip',
    '/usr/lib/python3.8',
    '/usr/lib/python3.8/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x0000007fa0bc1780 (most recent call first):
<no Python frame>
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1145: pushd: /home/pi/Downloads/CodeProject.AI-Server-main/src/runtimes/bin/linux/python38/venv/bin: No such file or directory
Installing setuptools...Done
Choosing packages from requirements.linux.arm64.txt
  - Installing Pandas, a data analysis / data manipulation tool...(failed check) Done
  - Installing CoreMLTools, for working with .mlmodel format models...(failed check) Done
  - Installing OpenCV, the Open source Computer Vision library...(failed check) Done
  - Installing Pillow, a Python Image Library...(failed check) Done
  - Installing SciPy, a library for mathematics, science, and engineering...(failed check) Done
  - Installing PyYAML, a library for reading configuration files...(failed check) Done
  -Installing torch==1.9.0...(failed check) Done
  -Installing torchvision==0.10.0...(failed check) Done
  - Installing Seaborn, a data visualization library based on matplotlib...(failed check) Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1267: popd: directory stack empty
Downloading Scene classification models... already exists...Expanding...Done.
Installing Server SDK support:
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1145: pushd: /home/pi/Downloads/CodeProject.AI-Server-main/src/runtimes/bin/linux/python38/venv/bin: No such file or directory
Installing setuptools...Done
Choosing packages from requirements.txt
  - Installing Charset normalizer...(failed check) Done
  - Installing aiohttp, the Async IO HTTP library...(failed check) Done
  - Installing aiofiles, the Async IO Files library...(failed check) Done
  - Installing py-cpuinfo to allow us to query CPU info...(failed check) Done
  - Installing Requests, the HTTP library...(failed check) Done
  - Installing Pillow, a Python Image Library...(failed check) Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1267: popd: directory stack empty

Processing module SentimentAnalysis 1.4                               


Processing module SuperResolution 1.6                                 

Python 3.8 is already installed
Installing Virtual Environment tools for Linux...Done
Creating Virtual Environment (Local)...Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python3.8'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python3.8'
  sys.base_prefix = '/usr'
  sys.base_exec_prefix = '/usr'
  sys.executable = '/usr/bin/python3.8'
  sys.prefix = '/usr'
  sys.exec_prefix = '/usr'
  sys.path = [
    '/usr/lib/python38.zip',
    '/usr/lib/python3.8',
    '/usr/lib/python3.8/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x0000007f99093780 (most recent call first):
<no Python frame>
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1145: pushd: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/SuperResolution/bin/linux/python38/venv/bin: No such file or directory
Installing setuptools...Done
Choosing packages from requirements.linux.txt
  - Installing ONNX, the Open Neural Network Exchange library...(failed check) Done
  - Installing ONNX runtime, the scoring engine for ONNX models...(failed check) Done
  - Installing resizeimage, which provides functions for easily resizing images...(failed check) Done
  - Installing Pillow, a Python Image Library...(failed check) Done
  - Installing Torch, for Tensor computation and Deep neural networks...(failed check) Done
  - Installing NumPy, a package for scientific computing...(failed check) Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1267: popd: directory stack empty
Installing Server SDK support:
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1145: pushd: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/SuperResolution/bin/linux/python38/venv/bin: No such file or directory
Installing setuptools...Done
Choosing packages from requirements.txt
  - Installing Charset normalizer...(failed check) Done
  - Installing aiohttp, the Async IO HTTP library...(failed check) Done
  - Installing aiofiles, the Async IO Files library...(failed check) Done
  - Installing py-cpuinfo to allow us to query CPU info...(failed check) Done
  - Installing Requests, the HTTP library...(failed check) Done
  - Installing Pillow, a Python Image Library...(failed check) Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1267: popd: directory stack empty

Processing module TextSummary 1.4                                     

Python 3.8 is already installed
Installing Virtual Environment tools for Linux...Done
Creating Virtual Environment (Local)...Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python3.8'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python3.8'
  sys.base_prefix = '/usr'
  sys.base_exec_prefix = '/usr'
  sys.executable = '/usr/bin/python3.8'
  sys.prefix = '/usr'
  sys.exec_prefix = '/usr'
  sys.path = [
    '/usr/lib/python38.zip',
    '/usr/lib/python3.8',
    '/usr/lib/python3.8/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x0000007f9f696780 (most recent call first):
<no Python frame>
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1145: pushd: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/TextSummary/bin/linux/python38/venv/bin: No such file or directory
Installing setuptools...Done
Choosing packages from requirements.txt
  - Installing NumPy, the fundamental package for array computing with Python....(failed check) Done
  - Installing NLTK, the Natural Language Toolkit...(failed check) Done
  - Installing NetworkX, a package for creating and manipulating graphs and networks...(failed check) Done
  - Installing SciPy, a library for mathematics, science, and engineering...(failed check) Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1267: popd: directory stack empty
Installing Server SDK support:
Checking for CUDA...Not found
Installing PIP...Done
Ensuring PIP compatibility...Done
Updating PIP...Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1145: pushd: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/TextSummary/bin/linux/python38/venv/bin: No such file or directory
Installing setuptools...Done
Choosing packages from requirements.txt
  - Installing Charset normalizer...(failed check) Done
  - Installing aiohttp, the Async IO HTTP library...(failed check) Done
  - Installing aiofiles, the Async IO Files library...(failed check) Done
  - Installing py-cpuinfo to allow us to query CPU info...(failed check) Done
  - Installing Requests, the HTTP library...(failed check) Done
  - Installing Pillow, a Python Image Library...(failed check) Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1267: popd: directory stack empty

Processing module TrainingYoloV5 1.3                                  

Python 3.8 is already installed
Installing Virtual Environment tools for Linux...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package python3.8-venv
E: Couldn't find any package by glob 'python3.8-venv'
Creating Virtual Environment (Local)...Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python3.8'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python3.8'
  sys.base_prefix = '/usr'
  sys.base_exec_prefix = '/usr'
  sys.executable = '/usr/bin/python3.8'
  sys.prefix = '/usr'
  sys.exec_prefix = '/usr'
  sys.path = [
    '/usr/lib/python38.zip',
    '/usr/lib/python3.8',
    '/usr/lib/python3.8/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x0000007fafce9780 (most recent call first):
<no Python frame>
Ensuring libcurl4 present...Done
Checking for CUDA...Not found
Ensuring PIP is installed and up to date...
Installing PIP...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-pip is already the newest version (20.3.4-4+rpt1+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Ensuring PIP compatibility ...
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1134: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/TrainingYoloV5/bin/linux/python38/venv/bin/python3.8: No such file or directory
Updating PIP...
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1137: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/TrainingYoloV5/bin/linux/python38/venv/bin/python3.8: No such file or directory
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1145: pushd: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/TrainingYoloV5/bin/linux/python38/venv/bin: No such file or directory
Installing setuptools...Done
Choosing packages from requirements.txt
  - Installing urllib3, the HTTP client for Python...(failed check) Done
  - Installing matplotlib, the python plotting package...(failed check) Done
  - Installing NumPy, a package for scientific computing...(failed check) Done
  - Installing OpenCV, the Open source Computer Vision library...(failed check) Done
  - Installing Pillow, a Python Image Library...(failed check) Done
  - Installing PyYAML, a library for reading configuration files...(failed check) Done
  - Installing request, the HTTP library...(failed check) Done
  - Installing SciPy, a library for mathematics, science, and engineering...(failed check) Done
  - Installing Torch, for Tensor computation and Deep neural networks...(failed check) Done
  - Installing TorchVision, for Computer Vision based AI...(failed check) Done
  - Installing tdqm, the Fast, Extensible Progress Meter...(failed check) Done
  - Installing protobuf, extensible mechanisms for serializing structured data...(failed check) Done
  - Installing tensorboard, a tool to let you watch Tensors Flow...(failed check) Done
  - Installing Pandas, a data analysis / data manipulation tool...(failed check) Done
  - Installing Seaborn, a data visualization library based on matplotlib...(failed check) Done
  - Installing ipython, for interactive notebooks...(failed check) Done
  - Installing psutil, a tool to check system utilization...(failed check) Done
  - Installing thop, a tool to count the FLOPs of PyTorch model....(failed check) Done
  - Installing Ultralytics YoloV5 package for object detection in images...(failed check) Done
  - Installing fiftyone, for building datasets and computer vision models...(failed check) Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1267: popd: directory stack empty
Downloading models-yolo5-pt.zip to /home/pi/Downloads/CodeProject.AI-Server-main/src/downloads/TrainingYoloV5
Downloading Standard YOLO models... already exists...Expanding...Done.
sending incremental file list

sent 100 bytes  received 12 bytes  224.00 bytes/sec
total size is 156,824,238  speedup is 1,400,216.41
Installing Server SDK support:
Checking for CUDA...Not found
Ensuring PIP is installed and up to date...
Installing PIP...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-pip is already the newest version (20.3.4-4+rpt1+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Ensuring PIP compatibility ...
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1134: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/TrainingYoloV5/bin/linux/python38/venv/bin/python3.8: No such file or directory
Updating PIP...
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1137: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/TrainingYoloV5/bin/linux/python38/venv/bin/python3.8: No such file or directory
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1145: pushd: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/TrainingYoloV5/bin/linux/python38/venv/bin: No such file or directory
Installing setuptools...Done
Choosing packages from requirements.txt
  - Installing Charset normalizer...(failed check) Done
  - Installing aiohttp, the Async IO HTTP library...(failed check) Done
  - Installing aiofiles, the Async IO Files library...(failed check) Done
  - Installing py-cpuinfo to allow us to query CPU info...(failed check) Done
  - Installing Requests, the HTTP library...(failed check) Done
  - Installing Pillow, a Python Image Library...(failed check) Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1267: popd: directory stack empty

Processing module YOLOv5-3.1 1.5                                      

Python 3.8 is already installed
Installing Virtual Environment tools for Linux...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package python3.8-venv
E: Couldn't find any package by glob 'python3.8-venv'
Creating Virtual Environment (Local)...Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python3.8'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python3.8'
  sys.base_prefix = '/usr'
  sys.base_exec_prefix = '/usr'
  sys.executable = '/usr/bin/python3.8'
  sys.prefix = '/usr'
  sys.exec_prefix = '/usr'
  sys.path = [
    '/usr/lib/python38.zip',
    '/usr/lib/python3.8',
    '/usr/lib/python3.8/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x0000007f9be21780 (most recent call first):
<no Python frame>
Checking for CUDA...Not found
Ensuring PIP is installed and up to date...
Installing PIP...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-pip is already the newest version (20.3.4-4+rpt1+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Ensuring PIP compatibility ...
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1134: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/YOLOv5-3.1/bin/linux/python38/venv/bin/python3.8: No such file or directory
Updating PIP...
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1137: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/YOLOv5-3.1/bin/linux/python38/venv/bin/python3.8: No such file or directory
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1145: pushd: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/YOLOv5-3.1/bin/linux/python38/venv/bin: No such file or directory
Installing setuptools...Done
Choosing packages from requirements.linux.arm64.txt
  - Installing OpenCV, the Open source Computer Vision library...(failed check) Done
  - Installing the Cython compiler for C extensions for the Python language...(failed check) Done
  - Installing Pillow, a Python Image Library...(failed check) Done
  - Installing SciPy, a library for mathematics, science, and engineering...(failed check) Done
  - Installing PyYAML, a library for reading configuration files...(failed check) Done
  - Installing TDQM, the Fast, Extensible Progress Meter...(failed check) Done
  - Installing Matplotlib, the Python plotting package...(failed check) Done
  - Installing PyTorch, for Tensor computation and Deep neural networks...(failed check) Done
  - Installing TorchVision, for Computer Vision based AI...(failed check) Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1267: popd: directory stack empty
Downloading models-yolo5-31-pt.zip to /home/pi/Downloads/CodeProject.AI-Server-main/src/downloads/YOLOv5-3.1
Downloading Standard YOLOv5 models... already exists...Expanding...Done.
sending incremental file list

sent 86 bytes  received 12 bytes  196.00 bytes/sec
total size is 155,237,225  speedup is 1,584,053.32
Downloading custom-models-yolo5-31-pt.zip to /home/pi/Downloads/CodeProject.AI-Server-main/src/downloads/YOLOv5-3.1
Downloading Custom YOLOv5 models... already exists...Expanding...Done.
sending incremental file list

sent 148 bytes  received 12 bytes  320.00 bytes/sec
total size is 74,137,566  speedup is 463,359.79
Installing Server SDK support:
Checking for CUDA...Not found
Ensuring PIP is installed and up to date...
Installing PIP...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-pip is already the newest version (20.3.4-4+rpt1+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Ensuring PIP compatibility ...
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1134: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/YOLOv5-3.1/bin/linux/python38/venv/bin/python3.8: No such file or directory
Updating PIP...
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1137: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/YOLOv5-3.1/bin/linux/python38/venv/bin/python3.8: No such file or directory
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1145: pushd: /home/pi/Downloads/CodeProject.AI-Server-main/src/modules/YOLOv5-3.1/bin/linux/python38/venv/bin: No such file or directory
Installing setuptools...Done
Choosing packages from requirements.txt
  - Installing Charset normalizer...(failed check) Done
  - Installing aiohttp, the Async IO HTTP library...(failed check) Done
  - Installing aiofiles, the Async IO Files library...(failed check) Done
  - Installing py-cpuinfo to allow us to query CPU info...(failed check) Done
  - Installing Requests, the HTTP library...(failed check) Done
  - Installing Pillow, a Python Image Library...(failed check) Done
/home/pi/Downloads/CodeProject.AI-Server-main/src/SDK/Scripts/utils.sh: line 1267: popd: directory stack empty

Module setup Complete


Processing demos                                                      

Python 3.9 is already installed
Virtual Environment already present
Checking for Python 3.9...Found Python 3.9.2. present
Checking for CUDA...Not found
Ensuring PIP is installed and up to date...
Installing PIP...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-pip is already the newest version (20.3.4-4+rpt1+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Ensuring PIP compatibility ...
Looking in links: /tmp/tmpber1cw11
Requirement already satisfied: setuptools in ./runtimes/bin/linux/python39/venv/lib/python3.9/site-packages (68.2.2)
Requirement already satisfied: pip in ./runtimes/bin/linux/python39/venv/lib/python3.9/site-packages (23.3.1)
Requirement already satisfied: pkg_resources in ./runtimes/bin/linux/python39/venv/lib/python3.9/site-packages (0.0.0)
Updating PIP...
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pip in ./runtimes/bin/linux/python39/venv/lib/python3.9/site-packages (23.3.1)
Installing setuptools...Done
Choosing packages from requirements.txt
  - Installing the image utilities library...Already installed
  - Installing OpenCV, the Computer Vision library for Python...Already installed
  - Installing NumPy, a package for scientific computing...Already installed
Done

                Setup complete                                        


pi@IspyAgent:~/Downloads/CodeProject.AI-Server-main/src $ 

GeneralRe: Server Pin
Chris Maunder3-Nov-23 9:15
cofounderChris Maunder3-Nov-23 9:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.