Skip to content
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

How to deploy custom YOLOv8 model #8099

Closed
shahzaibkhan9 opened this issue Jun 28, 2024 · 5 comments
Closed

How to deploy custom YOLOv8 model #8099

shahzaibkhan9 opened this issue Jun 28, 2024 · 5 comments

Comments

@shahzaibkhan9
Copy link

Hi,

I've tried to deploy a custom yolov8 model but its throwing an error using this https://github.com/kurkurzz/custom-yolov8-auto-annotation-cvat-blueprint/tree/master.


24.06.28 08:15:24.467 (D) sor.http.w1.python.logger Running wrapper {"command": "/usr/bin/python3 -u /opt/nuclio/_nuclio_wrapper.py --handler main:handler --event-socket-path /tmp/nuclio-rpc-cpv727531lec738nhnog.sock --control-socket-path /tmp/nuclio-rpc-cpv727531lec738nhnq0.sock --platform-kind local --namespace nuclio --worker-id 1 --trigger-kind http --trigger-name myHttpTrigger --decode-event-strings"}
24.06.28 08:15:24.467 (D) sor.http.w0.python.logger Running wrapper {"command": "/usr/bin/python3 -u /opt/nuclio/_nuclio_wrapper.py --handler main:handler --event-socket-path /tmp/nuclio-rpc-cpv727531lec738nhnp0.sock --control-socket-path /tmp/nuclio-rpc-cpv727531lec738nhnpg.sock --platform-kind local --namespace nuclio --worker-id 0 --trigger-kind http --trigger-name myHttpTrigger --decode-event-strings"}
{"datetime": "2024-06-28 08:15:24,631", "level": "error", "message": "Caught unhandled exception while initializing", "with": {"err": "libGL.so.1: cannot open shared object file: No such file or directory", "traceback": "Traceback (most recent call last):\n File "/opt/nuclio/_nuclio_wrapper.py", line 543, in run_wrapper\n wrapper_instance = Wrapper(root_logger,\n File "/opt/nuclio/_nuclio_wrapper.py", line 88, in init\n self._entrypoint = self._load_entrypoint_from_handler(handler)\n File "/opt/nuclio/_nuclio_wrapper.py", line 331, in _load_entrypoint_from_handler\n module = import(module_name)\n File "/opt/nuclio/main.py", line 6, in \n from model_handler import ModelHandler\n File "/opt/nuclio/model_handler.py", line 5, in \n import cv2\n File "/usr/local/lib/python3.10/dist-packages/cv2/init.py", line 181, in \n bootstrap()\n File "/usr/local/lib/python3.10/dist-packages/cv2/init.py", line 153, in bootstrap\n native_module = importlib.import_module("cv2")\n File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\nImportError: libGL.so.1: cannot open shared object file: No such file or directory\n", "worker_id": "1"}}
24.06.28 08:15:24.654 (E) sor.http.w1.python.logger Unexpected termination of child process {"error": null, "status": "exit status 1"}
panic: Wrapper process for worker 1 exited unexpectedly with: exit status 1

goroutine 15 [running]:
github.com/nuclio/nuclio/pkg/processor/runtime/rpc.(*AbstractRuntime).watchWrapperProcess(0xc00026b7a0)
/home/runner/work/nuclio/nuclio/pkg/processor/runtime/rpc/abstract.go:663 +0x434
created by github.com/nuclio/nuclio/pkg/processor/runtime/rpc.(*AbstractRuntime).startWrapper in goroutine 14
/home/runner/work/nuclio/nuclio/pkg/processor/runtime/rpc/abstract.go:318 +0x1f1

/nuclio/pkg/platform/local/platform.go:1315

Failed to deploy function
...//nuclio/pkg/platform/abstract/platform.go:228


Can anyone help?

@bsekachev
Copy link
Member

There is a problem in your initialization code.

Please, see stacktrace.

libGL.so.1: cannot open shared object file: No such file or directory

@muhammadhumza10
Copy link

You need to link nuclio with the local storage of your model that way it can bind the cvat docker image with the local custom model and after that deploy it and it should work I've tested it myself as well.
cvat
nuclio-funtion

@shahzaibkhan9
Copy link
Author

Thank you @muhammadhumza10. Works fine now.

@venuss920
Copy link

Hey @muhammadhumza10 could you help me with the steps to do this process ? - You need to link nuclio with the local storage of your model that way it can bind the cvat docker image with the local custom model and after that deploy it and it should work I've tested it myself as well. that would be a great help. Because my pretrained weights are saved in a local directory, in it shows me this error
Dockerfile.processor:28

26 | RUN pip3 install git+https://github.com/huggingface/transformers.git
27 |
28 | >>> COPY model_params_fine_tune_original_size_with_patches.pth /opt/nuclio/
29 |
30 | RUN ln -s /usr/bin/pip3 /usr/local/bin/pip && ln -s /usr/bin/python3 /usr/bin/python, ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref c0cf5f2c-9127-41f4-91c3-43f9471edfc4::uku9o0g3lbsmr3zbj3u983atp: "/model_params_fine_tune_original_size_with_patches.pth": not found

/nuclio/pkg/cmdrunner/cmdrunner.go:124

Failed to build docker image
.../pkg/containerimagebuilderpusher/docker.go:56
Failed to build processor image
/nuclio/pkg/processor/build/builder.go:250
Failed to deploy function
...//nuclio/pkg/platform/abstract/platform.go:175

@shahzaibkhan9
Copy link
Author

@venuss920 Follow this guide to load your custom model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants