-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Display API key invalid when using one's own agent #752
Comments
👋 Hello @Aq114, thank you for raising an issue about Ultralytics HUB 🚀! Please visit our HUB Docs to learn more:
If this is a 🐛 Bug Report, please provide screenshots and steps to reproduce your problem to help us get started working on a fix. If this is a ❓ Question, please provide as much information as possible, including dataset, model, environment details etc. so that we might provide the most helpful response. We try to respond to all issues as promptly as possible. Thank you for your patience! |
@Aq114 hello, Thank you for reaching out and providing detailed information about the issue you're encountering. To better assist you, it would be very helpful if you could provide a minimal reproducible example of your code. This will allow us to replicate the issue on our end and diagnose the problem more effectively. You can find guidelines on how to create a minimal reproducible example here. In the meantime, please ensure that you are using the latest versions of all relevant packages, including the Ultralytics HUB SDK and YOLOv8. Sometimes, issues like these are resolved in newer releases. Regarding the specific error messages:
Here's a small snippet to adjust the DataLoader parameters: from ultralytics import YOLO
# Example of reducing the number of workers
model = YOLO('yolov8n.pt')
model.train(data='coco128.yaml', epochs=10, batch_size=8, workers=2) If you continue to experience issues, please share the minimal reproducible example, and we will investigate further. Thank you for your cooperation and patience. We look forward to resolving this issue for you. |
Thank you for your help. I can confirm that my API key is correct. Yesterday, I completed training on a custom dataset through my own agent and recently successfully trained on the provided coco128 dataset. But when I retrained a dataset similar to yesterday (dividing the original training set into training and validation sets, with the original validation set as the test set), these errors occurred. The following are screenshots and documents of relevant errors.
Traceback (most recent call last): File "C:\Users\Y\AppData\Local\anaconda3\envs\yolov5\Lib\site-packages\torch\utils\data\dataloader.py", line 1133, in _try_get_data data = self._data_queue.get(timeout=timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Y\AppData\Local\anaconda3\envs\yolov5\Lib\queue.py", line 179, in get raise Empty _queue.Empty The above exception was the direct cause of the following exception: Traceback (most recent call last): File "D:\Desktop\YOLO5\yolov5\1.py", line 12, in <module> main() File "D:\Desktop\YOLO5\yolov5\1.py", line 9, in main results = model.train() ^^^^^^^^^^^^^ File "C:\Users\Y\AppData\Local\anaconda3\envs\yolov5\Lib\site-packages\ultralytics\engine\model.py", line 650, in train self.trainer.train() File "C:\Users\Y\AppData\Local\anaconda3\envs\yolov5\Lib\site-packages\ultralytics\engine\trainer.py", line 204, in train self._do_train(world_size) File "C:\Users\Y\AppData\Local\anaconda3\envs\yolov5\Lib\site-packages\ultralytics\engine\trainer.py", line 429, in _do_train self.metrics, self.fitness = self.validate() ^^^^^^^^^^^^^^^ File "C:\Users\Y\AppData\Local\anaconda3\envs\yolov5\Lib\site-packages\ultralytics\engine\trainer.py", line 570, in validate metrics = self.validator(self) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Y\AppData\Local\anaconda3\envs\yolov5\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Y\AppData\Local\anaconda3\envs\yolov5\Lib\site-packages\ultralytics\engine\validator.py", line 169, in __call__ for batch_i, batch in enumerate(bar): File "C:\Users\Y\AppData\Local\anaconda3\envs\yolov5\Lib\site-packages\tqdm\std.py", line 1181, in __iter__ for obj in iterable: File "C:\Users\Y\AppData\Local\anaconda3\envs\yolov5\Lib\site-packages\ultralytics\data\build.py", line 48, in __iter__ yield next(self.iterator) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Y\AppData\Local\anaconda3\envs\yolov5\Lib\site-packages\torch\utils\data\dataloader.py", line 631, in __next__ data = self._next_data() ^^^^^^^^^^^^^^^^^ File "C:\Users\Y\AppData\Local\anaconda3\envs\yolov5\Lib\site-packages\torch\utils\data\dataloader.py", line 1329, in _next_data idx, data = self._get_data() ^^^^^^^^^^^^^^^^ File "C:\Users\Y\AppData\Local\anaconda3\envs\yolov5\Lib\site-packages\torch\utils\data\dataloader.py", line 1285, in _get_data success, data = self._try_get_data() ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Y\AppData\Local\anaconda3\envs\yolov5\Lib\site-packages\torch\utils\data\dataloader.py", line 1146, in _try_get_data raise RuntimeError(f'DataLoader worker (pid(s) {pids_str}) exited unexpectedly') from e RuntimeError: DataLoader worker (pid(s) 4704, 7508, 9648, 3544, 16652, 7588) exited unexpectedly
…------------------ 原始邮件 ------------------
发件人: "ultralytics/hub" ***@***.***>;
发送时间: 2024年7月2日(星期二) 下午3:21
***@***.***>;
***@***.******@***.***>;
主题: Re: [ultralytics/hub] Display API key invalid when using one's own agent (Issue #752)
@Aq114 hello,
Thank you for reaching out and providing detailed information about the issue you're encountering. To better assist you, it would be very helpful if you could provide a minimal reproducible example of your code. This will allow us to replicate the issue on our end and diagnose the problem more effectively. You can find guidelines on how to create a minimal reproducible example here.
In the meantime, please ensure that you are using the latest versions of all relevant packages, including the Ultralytics HUB SDK and YOLOv8. Sometimes, issues like these are resolved in newer releases.
Regarding the specific error messages:
Invalid API Key: Double-check that the API key you are using is correctly copied from the API settings page. Ensure there are no extra spaces or characters.
DataLoader worker exited unexpectedly: This could be related to several factors, including memory limitations or issues with the data loading process. You might want to try reducing the number of workers or batch size to see if that mitigates the issue.
Here's a small snippet to adjust the DataLoader parameters:
from ultralytics import YOLO # Example of reducing the number of workers model = YOLO('yolov8n.pt') model.train(data='coco128.yaml', epochs=10, batch_size=8, workers=2)
If you continue to experience issues, please share the minimal reproducible example, and we will investigate further.
Thank you for your cooperation and patience. We look forward to resolving this issue for you.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@Aq114 Hello! |
Hello, I have tried the method you mentioned and still encounter the same error. The key issue is that when I ran the dataset I customized yesterday and the dataset publicly available on the platform, there were no errors and I was able to successfully train. However, when I modified the customized dataset today (by adding a test set section), this error occurred. |
@Aq114 Looks like your error isn't related to the API key but to the dataset structure. |
Yes, I have also doubted this issue because the datasets I have successfully trained currently do not have a test set portion, and the custom dataset I made an error in is dividing the original training set into a new training set and a validation set, with the original validation set used as the new test set. But when I use the publicly available wild life dataset with training sets on the platform, it can also run. Thank you very much. I will try to rebuild the dataset again according to the pattern you provided. |
@Aq114 No worries, good luck! |
Unfortunately, I tried again today and unexpectedly failed again, still with this error. I think if there is an error in the construction structure of the dataset, it will fail to upload the dataset because I encountered this error a few days ago and will no longer display the API key during the training process. |
@Aq114 Before you upload your dataset, please make sure you validate it locally. from ultralytics.hub import check_dataset
check_dataset("path/to/dataset.zip", task="detect") |
Well,I have passed this check and the dataset can be successfully uploaded to the platform. The images and overview, as well as the partition of the dataset, can be displayed on the platform. There was only an error in the training step. Thank you again for your valuable advice and patience! |
Hello @Aq114, Thank you for your patience and for providing additional details. It's great to hear that your dataset passed the validation check and was successfully uploaded to the platform. Given that the issue arises during the training step, let's delve deeper into potential causes and solutions.
Here’s a small snippet to adjust the DataLoader parameters: from ultralytics import YOLO
# Example of reducing the number of workers and batch size
model = YOLO('yolov8n.pt')
model.train(data='path/to/your/dataset.yaml', epochs=10, batch_size=8, workers=2) If the issue persists, please provide any additional logs or error messages you encounter. This will help us diagnose the problem more effectively. Thank you for your cooperation and patience. We’re here to help you get this resolved! 😊 |
Search before asking
HUB Component
API Key
Bug
I encountered the following issue when using my own agent: Ultralytics HUB: Get API key from https://hub.ultralytics.com/settings?tab=api +keys and then run 'yolo hub login API_KEY'⚠️ 。 But when I checked the API, there were no errors, and the program eventually terminated unexpectedly: raise RuntimeError (f'DataLoader worker (pid (s) {pids str}) exited unexpectedly ') from e
2024-07-02 11:46:05,977 - hub_sdk.helpers.logger - WARNING - Ultralytics HUB-SDK: Invalid API key
RuntimeError: DataLoader worker (pid (s) 4168, 9180, 3524, 7872, 7664, 6560) exceeded unexpectedly. How can I solve it?
Environment
windows 11
python 3.11
Ultralytics YOLOv8.2.48 🚀 Python-3.11.9 torch-2.3.1 CUDA:0 (NVIDIA GeForce GTX 1050 Ti, 4096MiB)
Minimal Reproducible Example
Click on the dataset you have uploaded to train the model, use your own proxy, and copy the relevant code to run it in the Python file of PyCharm. After running for a period of time, this prompt will appear. During this period, the training iteration can still be repeated several times, but it will eventually stop unexpectedly.
Additional
No response
The text was updated successfully, but these errors were encountered: