YOLOV8 Project Dockerfile #3658
Replies: 1 comment
-
@najwabelarbi2 hello! It seems like you're encountering an issue with the OpenCV (cv2) library within your Docker container. The error message suggests there might be a problem with the installation of the cv2 module, possibly due to a circular import or an incomplete installation. Here are a few steps you can take to troubleshoot this issue:
If you continue to experience issues, you might find additional troubleshooting information in the Ultralytics Docs, which can provide guidance on setting up and using YOLOv8 in various environments. Best of luck with your object counting project! 🚀 |
Beta Was this translation helpful? Give feedback.
-
Hello everyone,
I hope this message find you well,
I am currently working on a project that consist of Counting objects that pass through a conveyor using YOLOV8 and Supervision.
I want to Dockerize my solution (that only contains a main python file), here is my Dockerfile content:
FROM ultralytics/ultralytics:latest-jetsons
RUN pip3 install supervision==0.3.0
COPY main_count.py .
CMD ["python3", "main_count.py"]
After building my docker image and running, I have the following error:
Traceback (most recent call last):
File "main_count.py", line 1, in
import cv2
File "/usr/local/lib/python3.8/dist-packages/cv2/init.py", line 181, in
bootstrap()
File "/usr/local/lib/python3.8/dist-packages/cv2/init.py", line 175, in bootstrap
if __load_extra_py_code_for_module("cv2", submodule, DEBUG):
File "/usr/local/lib/python3.8/dist-packages/cv2/init.py", line 28, in __load_extra_py_code_for_module
py_module = importlib.import_module(module_name)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/local/lib/python3.8/dist-packages/cv2/mat_wrapper/init.py", line 33, in
cv._registerMatType(Mat)
AttributeError: partially initialized module 'cv2' has no attribute '_registerMatType' (most likely due to a circular import)
What does it mean? how can I solve it? (PS: I'm still new to Docker)
Thank you in advance for your answer
Beta Was this translation helpful? Give feedback.
All reactions