Closed mandharsh38 closed 1 year ago
looks like the body of the http request isn't delivering the image correctly. are you using google chrome? the docs state that it's the only supported browser.
i just tried with the develop branch on https://github.com/cvat-ai/cvat and spun up an instance within WSL with the CPU version of YOLOv5 ... and it worked fine.
logs for comparison
i'm not getting "[W NNPACK.cpp:51] Could not initialize NNPACK! Reason: Unsupported hardware." although that seems to be just a warning.
docker logs nuclio-nuclio-ultralytics-yolov5
22.08.03 12:20:00.342 processor (I) Starting processor {"version": "Label: 1.9.3, Git commit: 0425d5958c6a6c3ab6508e83886d2867fe7bd82c, OS: linux, Arch: amd64, Go version: go1.17.10"}
22.08.03 12:20:00.342 processor (D) Read configuration {"config": "{\n \"metadata\": {\n \"name\": \"ultralytics-yolov5\",\n \"namespace\": \"nuclio\",\n \"labels\": {\n \"nuclio.io/project-name\": \"cvat\"\n },\n \"annotations\": {\n \"framework\": \"pytorch\",\n \"name\": \"YOLO v5\",\n \"spec\": \"[\\n { \\\"id\\\": 0, \\\"name\\\": \\\"person\\\" },\\n { \\\"id\\\": 1, \\\"name\\\": \\\"bicycle\\\" },\\n { \\\"id\\\": 2, \\\"name\\\": \\\"car\\\" },\\n { \\\"id\\\": 3, \\\"name\\\": \\\"motorbike\\\" },\\n { \\\"id\\\": 4, \\\"name\\\": \\\"aeroplane\\\" },\\n { \\\"id\\\": 5, \\\"name\\\": \\\"bus\\\" },\\n { \\\"id\\\": 6, \\\"name\\\": \\\"train\\\" },\\n { \\\"id\\\": 7, \\\"name\\\": \\\"truck\\\" },\\n { \\\"id\\\": 8, \\\"name\\\": \\\"boat\\\" },\\n { \\\"id\\\": 9, \\\"name\\\": \\\"traffic light\\\" },\\n { \\\"id\\\": 10, \\\"name\\\": \\\"fire hydrant\\\" },\\n { \\\"id\\\": 11, \\\"name\\\": \\\"stop sign\\\" },\\n { \\\"id\\\": 12, \\\"name\\\": \\\"parking meter\\\" },\\n { \\\"id\\\": 13, \\\"name\\\": \\\"bench\\\" },\\n { \\\"id\\\": 14, \\\"name\\\": \\\"bird\\\" },\\n { \\\"id\\\": 15, \\\"name\\\": \\\"cat\\\" },\\n { \\\"id\\\": 16, \\\"name\\\": \\\"dog\\\" },\\n { \\\"id\\\": 17, \\\"name\\\": \\\"horse\\\" },\\n { \\\"id\\\": 18, \\\"name\\\": \\\"sheep\\\" },\\n { \\\"id\\\": 19, \\\"name\\\": \\\"cow\\\" },\\n { \\\"id\\\": 20, \\\"name\\\": \\\"elephant\\\" },\\n { \\\"id\\\": 21, \\\"name\\\": \\\"bear\\\" },\\n { \\\"id\\\": 22, \\\"name\\\": \\\"zebra\\\" },\\n { \\\"id\\\": 23, \\\"name\\\": \\\"giraffe\\\" },\\n { \\\"id\\\": 24, \\\"name\\\": \\\"backpack\\\" },\\n { \\\"id\\\": 25, \\\"name\\\": \\\"umbrella\\\" },\\n { \\\"id\\\": 26, \\\"name\\\": \\\"handbag\\\" },\\n { \\\"id\\\": 27, \\\"name\\\": \\\"tie\\\" },\\n { \\\"id\\\": 28, \\\"name\\\": \\\"suitcase\\\" },\\n { \\\"id\\\": 29, \\\"name\\\": \\\"frisbee\\\" },\\n { \\\"id\\\": 30, \\\"name\\\": \\\"skis\\\" },\\n { \\\"id\\\": 31, \\\"name\\\": \\\"snowboard\\\" },\\n { \\\"id\\\": 32, \\\"name\\\": \\\"sports ball\\\" },\\n { \\\"id\\\": 33, \\\"name\\\": \\\"kite\\\" },\\n { \\\"id\\\": 34, \\\"name\\\": \\\"baseball bat\\\" },\\n { \\\"id\\\": 35, \\\"name\\\": \\\"baseball glove\\\" },\\n { \\\"id\\\": 36, \\\"name\\\": \\\"skateboard\\\" },\\n { \\\"id\\\": 37, \\\"name\\\": \\\"surfboard\\\" },\\n { \\\"id\\\": 38, \\\"name\\\": \\\"tennis racket\\\" },\\n { \\\"id\\\": 39, \\\"name\\\": \\\"bottle\\\" },\\n { \\\"id\\\": 40, \\\"name\\\": \\\"wine glass\\\" },\\n { \\\"id\\\": 41, \\\"name\\\": \\\"cup\\\" },\\n { \\\"id\\\": 42, \\\"name\\\": \\\"fork\\\" },\\n { \\\"id\\\": 43, \\\"name\\\": \\\"knife\\\" },\\n { \\\"id\\\": 44, \\\"name\\\": \\\"spoon\\\" },\\n { \\\"id\\\": 45, \\\"name\\\": \\\"bowl\\\" },\\n { \\\"id\\\": 46, \\\"name\\\": \\\"banana\\\" },\\n { \\\"id\\\": 47, \\\"name\\\": \\\"apple\\\" },\\n { \\\"id\\\": 48, \\\"name\\\": \\\"sandwich\\\" },\\n { \\\"id\\\": 49, \\\"name\\\": \\\"orange\\\" },\\n { \\\"id\\\": 50, \\\"name\\\": \\\"broccoli\\\" },\\n { \\\"id\\\": 51, \\\"name\\\": \\\"carrot\\\" },\\n { \\\"id\\\": 52, \\\"name\\\": \\\"hot dog\\\" },\\n { \\\"id\\\": 53, \\\"name\\\": \\\"pizza\\\" },\\n { \\\"id\\\": 54, \\\"name\\\": \\\"donut\\\" },\\n { \\\"id\\\": 55, \\\"name\\\": \\\"cake\\\" },\\n { \\\"id\\\": 56, \\\"name\\\": \\\"chair\\\" },\\n { \\\"id\\\": 57, \\\"name\\\": \\\"sofa\\\" },\\n { \\\"id\\\": 58, \\\"name\\\": \\\"pottedplant\\\" },\\n { \\\"id\\\": 59, \\\"name\\\": \\\"bed\\\" },\\n { \\\"id\\\": 60, \\\"name\\\": \\\"diningtable\\\" },\\n { \\\"id\\\": 61, \\\"name\\\": \\\"toilet\\\" },\\n { \\\"id\\\": 62, \\\"name\\\": \\\"tvmonitor\\\" },\\n { \\\"id\\\": 63, \\\"name\\\": \\\"laptop\\\" },\\n { \\\"id\\\": 64, \\\"name\\\": \\\"mouse\\\" },\\n { \\\"id\\\": 65, \\\"name\\\": \\\"remote\\\" },\\n { \\\"id\\\": 66, \\\"name\\\": \\\"keyboard\\\" },\\n { \\\"id\\\": 67, \\\"name\\\": \\\"cell phone\\\" },\\n { \\\"id\\\": 68, \\\"name\\\": \\\"microwave\\\" },\\n { \\\"id\\\": 69, \\\"name\\\": \\\"oven\\\" },\\n { \\\"id\\\": 70, \\\"name\\\": \\\"toaster\\\" },\\n { \\\"id\\\": 71, \\\"name\\\": \\\"sink\\\" },\\n { \\\"id\\\": 72, \\\"name\\\": \\\"refrigerator\\\" },\\n { \\\"id\\\": 73, \\\"name\\\": \\\"book\\\" },\\n { \\\"id\\\": 74, \\\"name\\\": \\\"clock\\\" },\\n { \\\"id\\\": 75, \\\"name\\\": \\\"vase\\\" },\\n { \\\"id\\\": 76, \\\"name\\\": \\\"scissors\\\" },\\n { \\\"id\\\": 77, \\\"name\\\": \\\"teddy bear\\\" },\\n { \\\"id\\\": 78, \\\"name\\\": \\\"hair drier\\\" },\\n { \\\"id\\\": 79, \\\"name\\\": \\\"toothbrush\\\" }\\n]\\n\",\n \"type\": \"detector\"\n }\n },\n \"spec\": {\n \"description\": \"YOLO v5 via pytorch hub\",\n \"handler\": \"main:handler\",\n \"runtime\": \"python:3.6\",\n \"resources\": {\n \"requests\": {\n \"cpu\": \"25m\",\n \"memory\": \"1Mi\"\n }\n },\n \"image\": \"cvat/ultralytics-yolov5:latest\",\n \"targetCPU\": 75,\n \"triggers\": {\n \"myHttpTrigger\": {\n \"class\": \"\",\n \"kind\": \"http\",\n \"name\": \"myHttpTrigger\",\n \"maxWorkers\": 2,\n \"workerAvailabilityTimeoutMilliseconds\": 10000,\n \"attributes\": {\n \"maxRequestBodySize\": 33554432\n }\n }\n },\n \"volumes\": [\n {\n \"volume\": {\n \"name\": \"volume-1\",\n \"hostPath\": {\n \"path\": \"/home/cvat/serverless/pytorch/common\"\n }\n },\n \"volumeMount\": {\n \"name\": \"volume-1\",\n \"mountPath\": \"/opt/nuclio/common\"\n }\n }\n ],\n \"build\": {\n \"image\": \"cvat/ultralytics-yolov5\",\n \"baseImage\": \"ultralytics/yolov5:latest-cpu\",\n \"directives\": {\n \"preCopy\": [\n {\n \"kind\": \"USER\",\n \"value\": \"root\"\n },\n {\n \"kind\": \"RUN\",\n \"value\": \"apt update \\u0026\\u0026 apt install --no-install-recommends -y libglib2.0-0\"\n },\n {\n \"kind\": \"WORKDIR\",\n \"value\": \"/opt/nuclio\"\n }\n ]\n },\n \"codeEntryType\": \"image\",\n \"timestamp\": 1659529198\n },\n \"platform\": {\n \"attributes\": {\n \"mountMode\": \"volume\",\n \"restartPolicy\": {\n \"maximumRetryCount\": 3,\n \"name\": \"always\"\n }\n }\n },\n \"readinessTimeoutSeconds\": 120,\n \"securityContext\": {},\n \"eventTimeout\": \"30s\"\n },\n \"PlatformConfig\": null\n}", "platformConfig": "{\n \"kind\": \"local\",\n \"webAdmin\": {\n \"enabled\": true,\n \"listenAddress\": \":8081\"\n },\n \"healthCheck\": {\n \"enabled\": true,\n \"listenAddress\": \":8082\"\n },\n \"logger\": {\n \"sinks\": {\n \"stdout\": {\n \"kind\": \"stdout\"\n }\n },\n \"system\": [\n {\n \"level\": \"debug\",\n \"sink\": \"stdout\"\n }\n ],\n \"functions\": [\n {\n \"level\": \"debug\",\n \"sink\": \"stdout\"\n }\n ]\n },\n \"metrics\": {},\n \"scaleToZero\": {\n \"multiTargetStrategy\": \"random\"\n },\n \"autoScale\": {},\n \"cronTriggerCreationMode\": \"processor\",\n \"functionReadinessTimeout\": \"2m0s\",\n \"ingressConfig\": {},\n \"kube\": {\n \"defaultServiceType\": \"ClusterIP\",\n \"defaultFunctionPodResources\": {\n \"requests\": {},\n \"limits\": {}\n }\n },\n \"local\": {\n \"FunctionContainersHealthinessEnabled\": false,\n \"FunctionContainersHealthinessTimeout\": 5000000000,\n \"FunctionContainersHealthinessInterval\": 30000000000\n },\n \"imageRegistryOverrides\": {},\n \"opa\": {\n \"address\": \"127.0.0.1:8181\",\n \"clientKind\": \"nop\",\n \"requestTimeout\": 10,\n \"permissionQueryPath\": \"/v1/data/iguazio/authz/allow\",\n \"permissionFilterPath\": \"/v1/data/iguazio/authz/filter_allowed\"\n },\n \"streamMonitoring\": {\n \"webapiURL\": \"http://v3io-webapi:8081\",\n \"v3ioRequestConcurrency\": 64\n }\n}"}
22.08.03 12:20:00.342 cessor.healthcheck.server (I) Listening {"listenAddress": ":8082"}
22.08.03 12:20:00.342 processor.http (D) Creating worker pool {"num": 2}
22.08.03 12:20:00.342 sor.http.w1.python.logger (D) Creating listener socket {"path": "/tmp/nuclio-rpc-cbl6fs5isclmr04d3g7g.sock"}
22.08.03 12:20:00.342 sor.http.w1.python.logger (W) Python 3.6 runtime is deprecated and will soon not be supported. Please migrate your code and use Python 3.7 runtime (`python:3.7`) or higher
22.08.03 12:20:00.342 sor.http.w1.python.logger (D) Using Python wrapper script path {"path": "/opt/nuclio/_nuclio_wrapper.py"}
22.08.03 12:20:00.342 sor.http.w1.python.logger (D) Using Python handler {"handler": "main:handler"}
22.08.03 12:20:00.343 sor.http.w1.python.logger (D) Using Python executable {"path": "/usr/bin/python3"}
22.08.03 12:20:00.343 sor.http.w1.python.logger (D) Setting PYTHONPATH {"value": "PYTHONPATH=/opt/nuclio"}
22.08.03 12:20:00.343 sor.http.w1.python.logger (D) Running wrapper {"command": "/usr/bin/python3 -u /opt/nuclio/_nuclio_wrapper.py --handler main:handler --socket-path /tmp/nuclio-rpc-cbl6fs5isclmr04d3g7g.sock --platform-kind local --namespace nuclio --worker-id 1 --trigger-kind http --trigger-name myHttpTrigger --decode-event-strings"}
22.08.03 12:20:00.343 sor.http.w0.python.logger (D) Creating listener socket {"path": "/tmp/nuclio-rpc-cbl6fs5isclmr04d3g80.sock"}
22.08.03 12:20:00.343 sor.http.w0.python.logger (W) Python 3.6 runtime is deprecated and will soon not be supported. Please migrate your code and use Python 3.7 runtime (`python:3.7`) or higher
22.08.03 12:20:00.343 sor.http.w0.python.logger (D) Using Python wrapper script path {"path": "/opt/nuclio/_nuclio_wrapper.py"}
22.08.03 12:20:00.343 sor.http.w0.python.logger (D) Using Python handler {"handler": "main:handler"}
22.08.03 12:20:00.343 sor.http.w0.python.logger (D) Using Python executable {"path": "/usr/bin/python3"}
22.08.03 12:20:00.343 sor.http.w0.python.logger (D) Setting PYTHONPATH {"value": "PYTHONPATH=/opt/nuclio"}
22.08.03 12:20:00.343 sor.http.w0.python.logger (D) Running wrapper {"command": "/usr/bin/python3 -u /opt/nuclio/_nuclio_wrapper.py --handler main:handler --socket-path /tmp/nuclio-rpc-cbl6fs5isclmr04d3g80.sock --platform-kind local --namespace nuclio --worker-id 0 --trigger-kind http --trigger-name myHttpTrigger --decode-event-strings"}
22.08.03 12:20:01.152 sor.http.w0.python.logger (I) Wrapper connected {"wid": 0, "pid": 16}
22.08.03 12:20:01.152 sor.http.w0.python.logger (D) Waiting for start
{"datetime": "2022-08-03 12:20:01,152", "level": "info", "message": "Replacing logger output", "with": {"handler_name": "default", "worker_id": "0"}}
22.08.03 12:20:01.152 sor.http.w1.python.logger (I) Wrapper connected {"wid": 1, "pid": 15}
22.08.03 12:20:01.152 sor.http.w1.python.logger (D) Waiting for start
22.08.03 12:20:01.152 sor.http.w0.python.logger (I) Init context... 0% {"worker_id": "0"}
{"datetime": "2022-08-03 12:20:01,152", "level": "info", "message": "Replacing logger output", "with": {"handler_name": "default", "worker_id": "1"}}
22.08.03 12:20:01.152 sor.http.w1.python.logger (I) Init context... 0% {"worker_id": "1"}
/usr/local/lib/python3.8/dist-packages/torch/hub.py:266: UserWarning: You are about to download and run code from an untrusted repository. In a future release, this won't be allowed. To add the repository to your trusted list, change the command to {calling_fn}(..., trust_repo=False) and a command prompt will appear asking for an explicit confirmation of trust, or load(..., trust_repo=True), which will assume that the prompt is to be answered with 'yes'. You can also use load(..., trust_repo='check') which will only prompt for confirmation if the repo is not already trusted. This will eventually be the default behaviour
warnings.warn(
/usr/local/lib/python3.8/dist-packages/torch/hub.py:266: UserWarning: You are about to download and run code from an untrusted repository. In a future release, this won't be allowed. To add the repository to your trusted list, change the command to {calling_fn}(..., trust_repo=False) and a command prompt will appear asking for an explicit confirmation of trust, or load(..., trust_repo=True), which will assume that the prompt is to be answered with 'yes'. You can also use load(..., trust_repo='check') which will only prompt for confirmation if the repo is not already trusted. This will eventually be the default behaviour
warnings.warn(
Downloading: "https://github.com/ultralytics/yolov5/zipball/master" to /root/.cache/torch/hub/master.zip
Downloading: "https://github.com/ultralytics/yolov5/zipball/master" to /root/.cache/torch/hub/master.zip
YOLOv5 🚀 2022-8-3 Python-3.8.10 torch-1.12.0+cpu CPU
YOLOv5 🚀 2022-8-3 Python-3.8.10 torch-1.12.0+cpu CPU
Downloading https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5s.pt to yolov5s.pt...
Downloading https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5s.pt to yolov5s.pt...
100%|██████████| 14.1M/14.1M [00:02<00:00, 5.78MB/s]
100%|██████████| 14.1M/14.1M [00:02<00:00, 5.76MB/s]
Fusing layers...
Fusing layers...
YOLOv5s summary: 213 layers, 7225885 parameters, 0 gradients
Adding AutoShape...
Init context...100%
22.08.03 12:20:15.064 sor.http.w1.python.logger (I) Init context...100% {"worker_id": "1"}
22.08.03 12:20:15.064 sor.http.w1.python.logger (D) Started
YOLOv5s summary: 213 layers, 7225885 parameters, 0 gradients
Adding AutoShape...
Init context...100%
22.08.03 12:20:15.079 sor.http.w0.python.logger (I) Init context...100% {"worker_id": "0"}
22.08.03 12:20:15.079 sor.http.w0.python.logger (D) Started
22.08.03 12:20:15.079 processor (I) Starting event timeout watcher {"timeout": "30s"}
22.08.03 12:20:15.079 .webadmin.server.triggers (D) Registered custom route {"routeName": "triggers", "stream": false, "pattern": "/{id}/stats", "method": "GET"}
22.08.03 12:20:15.079 processor.webadmin.server (D) Registered resource {"name": "triggers"}
22.08.03 12:20:15.079 processor (W) No metric sinks configured, metrics will not be published
22.08.03 12:20:15.079 processor (D) Starting triggers {"triggersError": "json: unsupported value: encountered a cycle via *http.http"}
22.08.03 12:20:15.080 processor.http (I) Starting {"listenAddress": ":8080", "readBufferSize": 16384, "maxRequestBodySize": 33554432, "reduceMemoryUsage": false, "cors": null}
22.08.03 12:20:15.081 processor.webadmin.server (I) Listening {"listenAddress": ":8081"}
22.08.03 12:20:15.081 processor (D) Processor started
Run yolo-v5 model
22.08.03 13:28:00.849 sor.http.w0.python.logger (I) Run yolo-v5 model {"worker_id": "0"}
22.08.03 13:28:33.916 sor.http.w1.python.logger (I) Run yolo-v5 model {"worker_id": "1"}
Run yolo-v5 model
Run yolo-v5 model
22.08.03 13:34:12.713 sor.http.w0.python.logger (I) Run yolo-v5 model {"worker_id": "0"}
@dschoerk , thanks for sharing. We did a number of fixes for serverless functions in https://github.com/cvat-ai/cvat repo. Don't hestitate to update the nuclio version: https://cvat-ai.github.io/cvat/docs/administration/advanced/installation_automatic_annotation/. It was updated as well.
Works now..updated nuctl and running: docker bridge fixed it. Thanks for the help.. @dschoerk @nmanovic
Hello @mandharsh38 , I'm having problems to auto annotate my own model with Yolo and the tutorial only shows detectron, could you explain about the changes you made at the function.yaml (the default one, to adapt at your own model) also main.py. I'm having problems with that.
I have same problem who can help me ? The link is broken.
automatic_annotation/. It was updated as well.
My actions before raising this issue
Read/searched the docs Searched past issues
Expected Behaviour
Should annotate automatically
Current Behaviour
Server Error Error: Request failed with status code 500. "500 Server Error: Internal Server Error for url: http://nuclio:8070/api/function_invocations".
Steps to Reproduce (for bugs)
1 run ./serverless/deploy_cpu.sh ./serverless/pytorch/ultralytics/yolov5/ 2 Create a task and try to auto-annotate using the detector yolo-v5
Context
Wanted to automatic annotate my custom dataset using yolov5 detector
Your Environment
20.10.17
(e.g. Docker 17.0.05):nuclio-nuclio-ultralytics-yolov5
container:Next steps
You may join our Gitter channel for community support.