huggingface / autotrain-advanced

🤗 AutoTrain Advanced
https://huggingface.co/autotrain
Apache License 2.0
3.84k stars 471 forks source link

[BUG] ObjectDetectionParams for uploaded Archive.zip has null data_path #654

Closed rileybolen closed 4 months ago

rileybolen commented 4 months ago

Prerequisites

Backend

Hugging Face Space/Endpoints

Interface Used

UI

CLI Command

No response

UI Screenshots & Parameters

Screenshot 2024-05-22 at 8 01 39 AM

Error Logs

Downloading data: 0%| | 0/802 [00:00<?, ?files/s] Downloading data: 100%|██████████| 802/802 [00:00<00:00, 17032.66files/s]

Downloading data: 0%| | 0/203 [00:00<?, ?files/s] Downloading data: 100%|██████████| 203/203 [00:00<00:00, 24711.04files/s]

Generating train split: 0 examples [00:00, ? examples/s] Generating train split: 514 examples [00:00, 5119.51 examples/s] Generating train split: 799 examples [00:00, 5513.06 examples/s]

Generating validation split: 0 examples [00:00, ? examples/s] Generating validation split: 200 examples [00:00, 6655.88 examples/s]

Saving the dataset (0/1 shards): 0%| | 0/799 [00:00<?, ? examples/s] Saving the dataset (0/1 shards): 100%|██████████| 799/799 [00:00<00:00, 4893.93 examples/s] Saving the dataset (1/1 shards): 100%|██████████| 799/799 [00:00<00:00, 4893.93 examples/s] Saving the dataset (1/1 shards): 100%|██████████| 799/799 [00:00<00:00, 4861.89 examples/s]

Saving the dataset (0/1 shards): 0%| | 0/200 [00:00<?, ? examples/s] Saving the dataset (1/1 shards): 100%|██████████| 200/200 [00:00<00:00, 5435.08 examples/s] Saving the dataset (1/1 shards): 100%|██████████| 200/200 [00:00<00:00, 5405.03 examples/s] INFO: 10.16.15.199:29069 - "POST /ui/create_project HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "/app/env/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 411, in run_asgi result = await app( # type: ignore[func-returns-value] File "/app/env/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in call return await self.app(scope, receive, send) File "/app/env/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in call await super().call(scope, receive, send) File "/app/env/lib/python3.10/site-packages/starlette/applications.py", line 123, in call await self.middleware_stack(scope, receive, send) File "/app/env/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in call raise exc File "/app/env/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in call await self.app(scope, receive, _send) File "/app/env/lib/python3.10/site-packages/starlette/middleware/sessions.py", line 85, in call await self.app(scope, receive, send_wrapper) File "/app/env/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 65, in call await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/app/env/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/app/env/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/app/env/lib/python3.10/site-packages/starlette/routing.py", line 756, in call await self.middleware_stack(scope, receive, send) File "/app/env/lib/python3.10/site-packages/starlette/routing.py", line 776, in app await route.handle(scope, receive, send) File "/app/env/lib/python3.10/site-packages/starlette/routing.py", line 297, in handle await self.app(scope, receive, send) File "/app/env/lib/python3.10/site-packages/starlette/routing.py", line 77, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/app/env/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/app/env/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/app/env/lib/python3.10/site-packages/starlette/routing.py", line 72, in app response = await func(request) File "/app/env/lib/python3.10/site-packages/fastapi/routing.py", line 278, in app raw_response = await run_endpoint_function( File "/app/env/lib/python3.10/site-packages/fastapi/routing.py", line 191, in run_endpoint_function return await dependant.call(values) File "/app/env/lib/python3.10/site-packages/autotrain/app/ui_routes.py", line 365, in handle_form params = app_params.munge() File "/app/env/lib/python3.10/site-packages/autotrain/app/params.py", line 150, in munge return self._munge_params_img_obj_det() File "/app/env/lib/python3.10/site-packages/autotrain/app/params.py", line 296, in _munge_params_img_obj_det return ObjectDetectionParams(_params) File "/app/env/lib/python3.10/site-packages/autotrain/trainers/common.py", line 158, in init super().init(**data) File "/app/env/lib/python3.10/site-packages/pydantic/main.py", line 176, in init self.__pydantic_validator__.validate_python(data, self_instance=self) pydantic_core._pydantic_core.ValidationError: 1 validation error for ObjectDetectionParams data_path Input should be a valid string [type=string_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.7/v/string_type

Additional Information

I am trying to fine tune an object detection model in an HF space using autotrain and the training fails to start. It seems to be getting farther than before (thanks for fixing the other bug) but now I see an error after the training and validation splits are created. It looks like the ObjectDetectionParams data_path property is None for my uploaded zip file. I am not sure if this is a bug or if I have formatted my data wrong, but I have followed the instructions in the docs. My Archive.zip contains only image files and metadata.jsonl.

abhishekkrthakur commented 4 months ago

can you paste a few lines from metadata.jsonl?

rileybolen commented 4 months ago

can you paste a few lines from metadata.jsonl? @abhishekkrthakur

{"file_name": "S05E01_1185266.jpg", "objects": {"bbox": [[275.7393, 75.5485, 183.911, 180.0954]], "categories": ["Face"]}}
{"file_name": "S06E23_1050098.jpg", "objects": {"bbox": [[188.744, 88.5215, 219.7774, 189.2528]], "categories": ["Face"]}}
{"file_name": "S06E23_315748.jpg", "objects": {"bbox": [[214.69, 237.3291, 225.8824, 181.6216], [472.6232, 281.5898, 161.7806, 123.6248], [57.4881, 194.5946, 136.5978, 154.1494]], "categories": ["Face", "Face", "Face"]}}
{"file_name": "S06E01_403252.jpg", "objects": {"bbox": [[316.9475, 45.0238, 135.0715, 186.9634], [110.9062, 49.6025, 144.9921, 180.0954]], "categories": ["Face", "Face"]}}
{"file_name": "S10E20_539538.jpg", "objects": {"bbox": [[134.5628, 51.1288, 185.4372, 193.0684], [423.7838, 78.601, 39.682, 83.1797], [3.3068, 173.2273, 54.9444, 48.8394]], "categories": ["Face", "Face", "Face"]}}
abhishekkrthakur commented 4 months ago

sorry, it was a stupid bug from my side. apologies for the inconvenience this has caused. fixed in version 0.7.105 and above.

rileybolen commented 4 months ago

No problem, thanks for the quick response!