-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Liicense Plate Reader 3.3.0 under CPAI version 2.8 and 2.65 "Failed to Start" #5
Comments
I found this on the internet. May be relevant to finding a solution to this problem. https://stackoverflow.com/questions/27064348/no-module-named-utils-error-on-compiling-py-file The specific error happens when the Python interpreter can't find a particular ".py" file. In your case, it is the file "utils.py". First you need to find which file is trying to import "utils.py". Starting with your main file, look up all the files you are importing. (I am guessing this issue is coming from one of the non-library files, but I could be wrong.) Once you have the "top level" import list, check each of those files to see what THEY are importing, and repeat the process for them. Eventually, you will find the .py file which is trying to import "utils". There might be a directory specification forcing Python to look in the wrong place. Finally, using windows' file manager, perform a search for "utils.py". As a temporary fix, you can copy it from its current location into your working directory. That will at least allow you to get your project up and running until you sort out the real cause. |
Note: I did a windows explorer search for utils.py and I'm finding the utils.py file in a couple of places. |
I'm wondering if this is an environment variables issue, where an environment variable is missing or is wrong and isn't pointing the code to the necessary place to find what it's looking for. Note that the environment variables is kinda cluttered from all of the various trials and errors of installing various CUDA, Cudnn, and Python versions in an attempt to get the modules to use the GPU. But, I don't see any environment variables pointing to any CodeProject directories and that's where the utils.py file resides. |
Uploading modulesettings.json file from ALPR 3.3.0 for reference. |
Note: re-installing License Plate Reader 3.3.0 does not resolve this problem. |
I tried re-installing CPAI version 2.8 and received a new error message when starting the License Plate Reader module 13:29:59:Server version: 2.8 This discussion on no known parent package may be relevent. |
Trying to reinstall License Plate Module. "GpuOptions" : { ALPR: - Installing PaddlePaddle, Parallel Distributed Deep Learning...(� failed check) done 13:49:11:ALPR: Executing post-install script for License Plate Reader |
This is a deep rabbit hole. I've tried installing Python 3.9, then This installed the paddle directory and paddle.py to the Python39 site-packages folder but not the CPAI ALPR folder, so I manually copied over the paddle folder and re-started License Plate reader. This led to errors not finding "decorator", so I downloaded using pip "decorator" and found a folder called decorator-5.1.1.dist-info folder in the Python39 site-packages folder. |
I find it interesting that the Yolo5 6.2 module is able to startup and utilize GPU and CUDA using it's detect_adapter.py code, which shows no mention of paddle or paddleocr. Paddle and paddleocr doesn't seem to be used or an issue for Yolo5 6.2 to work. There may be a reason why the License Plate Reader module chose to use paddle and paddleocr, maybe because of the OCR optical character recognition that is required? Regardless, I can't seem to get the License Plate Reader 3.3.0 module to stay up and running and am getting the many errors mentioned above. I have seen other posts showing that others are encountering similar, if not the same, issue as I am. |
Yes, we receive the same error using CPU version under docker since several months and no help to diagnose/fix the problem |
I haven't read through all of this issue but this could be of relevance. I just spun up CodeProject.AI-Server docker on an Ubuntu 24.04 host and was missing cudnn libraries to run OCR and ALPR, I worked around it by running a local docker image defined as so: FROM codeproject/ai-server:cuda12_2-2.8.0
RUN apt update && apt -y dist-upgrade && apt install -y cudnn && apt clean |
I have been fighting with this since upgrading to CPAI 2.8 / ALPR 3.3.0. I am running a GTX970. I was finally able to figure out how to get ALPR to start. I restarted ALPR, and it is working. As before, ALPR is using the CPU while YOLO 5.6.2 uses the GPU |
With the current ALPR version your GTX 970 is to old and is not supported. |
Roger that. ALPR hasn’t ever worked properly with my 970. It has always used the CPU. That has worked fine for my use case. The difference with this version is that it errored out on the install of paddlepaddle and wouldn’t even start. By manually installing paddlepaddle, I was able to get it to run on the CPU like before. BartOn Nov 10, 2024, at 6:03 PM, MikeLud ***@***.***> wrote:
I have been fighting with this since upgrading to CPAI 2.8 / ALPR 3.3.0. I am running a GTX970. I was finally able to figure out how to get ALPR to start. cd C:\Program Files\CodeProject\ai\modules\ALPR\bin\windows\python39\venv\Scripts run ".\python.exe -m pip install paddlepaddle" .\pip install paddlepaddle would have probably worked as well
I restarted ALPR, and it is working. As before, ALPR is using the CPU while YOLO 5.6.2 uses the GPU
With the current ALPR version your GTX 970 is to old and is not supported.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
I had the same issue, ie paddlepaddle fails to install when installing ALPR. I uninstalled my old 2.6.5 install after I did an upgrade to 2.8, and ALPR still failed to install as part of a clean codeprojectAI install. I ended up doing a manual install of paddlepaddle like @MrPeulin did (although I ended up shutting down CodeprojectAI, and installing |
@coderdude1 What version of CUDA are you on? 11.X or 12.X? I have a new release pending that doesn't fix the paddlepaddle-gpu to a specific version and that's working great on 12.x. If it works on 11.x then I'll update the req.txt for 11.X and include that in the next rev |
Do you have a fix for the Docker CPU version ? |
@xavan83 Define "fix" please. What specific issue are you seeing? Also: please don't hijack threads. It makes it too confusing to triage. |
|
Please try the latest docker. |
Area of Concern
Describe the bug
A clear and concise description of what the bug is.
In an attempt to get my Nvidia 1650 GPU graphics card to work with Yolo5 6.2 and License Plate Reader, I installed Nvidia Cuda 11.8. Cudnn 9.3. CPAI version 2.6.5, then CPAI server version 2.8. CPAI server version 2.8 got the Yolo5 6.2 to see and use the GPU, but License Plate Reader is failing to load and stops after 1 minute or less of being up. This License Plate Reader failed to start was also present in the CPAI server 2.65 version as well. My previous setup (Yolo5 6.2 and License Plate Reader was stable when on CPAI 2.6.5 using a Radeon graphics card and CPU only on the CPAI server. This License Plate Reader problem started after I switched to the Nvidia 1650 graphics card and started installing various CUDA versions (tried latest 12.6?, 11.7 and eventually settled on CUDA 11.8.
The license plate reader "failed to start" error seems to be centered around the log error messages related to:
![Screenshot 2024-08-27 120708](https://github.com/user-attachments/assets/141267ae-052c-4017-8fb9-854bf3d5242c)ALPR_adapter.py
ALPR.py
Expected behavior
License Plate Reader should start and stay up and not fail to start.
License Plate Reader should also use GPU rather than CPU since a usable Nvidia 1650 GPU is present and setup.
and the missing module utils.tools
ALPR_adapter.py: import utils.tools as tool
ALPR_adapter.py: ModuleNotFoundError: No module named 'utils.tools'
(see screen shot of log below)
Screenshots
11:48:08:Restarting License Plate Reader to apply settings change
11:48:08:
11:48:08:Module 'License Plate Reader' 3.3.0 (ID: ALPR)
11:48:08:Valid: True
11:48:08:Module Path: \modules\ALPR
11:48:08:Module Location: Internal
11:48:08:AutoStart: True
11:48:08:Queue: alpr_queue
11:48:08:Runtime: python3.9
11:48:08:Runtime Location: Local
11:48:08:FilePath: ALPR_adapter.py
11:48:08:Start pause: 3 sec
11:48:08:Parallelism: 0
11:48:08:LogVerbosity:
11:48:08:Platforms: all,!windows-arm64
11:48:08:GPU Libraries: installed if available
11:48:08:GPU: use if supported
11:48:08:Accelerator:
11:48:08:Half Precision: enable
11:48:08:Environment Variables
11:48:08:AUTO_PLATE_ROTATE = True
11:48:08:CROPPED_PLATE_DIR = \Server\wwwroot
11:48:08:MIN_COMPUTE_CAPABILITY = 6
11:48:08:MIN_CUDNN_VERSION = 7
11:48:08:OCR_OPTIMAL_CHARACTER_HEIGHT = 60
11:48:08:OCR_OPTIMAL_CHARACTER_WIDTH = 30
11:48:08:OCR_OPTIMIZATION = True
11:48:08:PLATE_CONFIDENCE = 0.7
11:48:08:PLATE_RESCALE_FACTOR = 2
11:48:08:PLATE_ROTATE_DEG = 0
11:48:08:REMOVE_SPACES = False
11:48:08:ROOT_PATH =
11:48:08:SAVE_CROPPED_PLATE = False
11:48:08:
11:48:08:Started License Plate Reader module
11:48:08:ALPR_adapter.py: Traceback (most recent call last):
11:48:08:ALPR_adapter.py: File "C:\Program Files\CodeProject\AI\modules\ALPR\ALPR_adapter.py", line 11, in
11:48:08:ALPR_adapter.py: from ALPR import init_detect_platenumber, detect_platenumber
11:48:08:ALPR_adapter.py: File "C:\Program Files\CodeProject\AI\modules\ALPR\ALPR.py", line 7, in
11:48:08:ALPR_adapter.py: import utils.tools as tool
11:48:08:ALPR_adapter.py: ModuleNotFoundError: No module named 'utils.tools'
11:48:08:Module ALPR has shutdown
11:48:08:ALPR_adapter.py: has exited
Your System (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: