ultralytics / hub

Ultralytics HUB tutorials and support
https://hub.ultralytics.com
GNU Affero General Public License v3.0
130 stars 11 forks source link

Implementation problem #380

Closed SMSajadi99 closed 11 months ago

SMSajadi99 commented 1 year ago

Search before asking

HUB Component

Training

Bug

Hello, I hope you are well I tried to run one of the datasets on your (site)[https://hub.ultralytics.com/datasets/] in my system, but unfortunately, it didn't run. I even tried to run it in colab, but it still had problems. my system:

from ultralytics import YOLO, checks, hub

checks()
hub.login('70e53a3ca9386b486074dd132ee540b326db4367fa')

model = YOLO('https://hub.ultralytics.com/models/tvIYOSDDUf4LHpp4Y9ZI')
model.train()

Result:

Ultralytics YOLOv8.0.170 πŸš€ Python-3.10.0 torch-2.0.1+cu117 CUDA:0 (NVIDIA GeForce GT 1030, 2048MiB)
Setup complete βœ… (16 CPUs, 15.6 GB RAM, 81.7/1006.9 GB disk)
---------------------------------------------------------------------------
JSONDecodeError                           Traceback (most recent call last)
File [~/anaconda3/envs/YOLOv8/lib/python3.10/site-packages/requests/models.py:971](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/sajadi/anaconda3/envs/YOLOv8/01-HubUltralytics/~/anaconda3/envs/YOLOv8/lib/python3.10/site-packages/requests/models.py:971), in Response.json(self, **kwargs)
    970 try:
--> 971     return complexjson.loads(self.text, **kwargs)
    972 except JSONDecodeError as e:
    973     # Catch JSON-related errors and raise as requests.JSONDecodeError
    974     # This aliases json.JSONDecodeError and simplejson.JSONDecodeError

File [~/anaconda3/envs/YOLOv8/lib/python3.10/json/__init__.py:346](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/sajadi/anaconda3/envs/YOLOv8/01-HubUltralytics/~/anaconda3/envs/YOLOv8/lib/python3.10/json/__init__.py:346), in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    343 if (cls is None and object_hook is None and
    344         parse_int is None and parse_float is None and
    345         parse_constant is None and object_pairs_hook is None and not kw):
--> 346     return _default_decoder.decode(s)
    347 if cls is None:

File [~/anaconda3/envs/YOLOv8/lib/python3.10/json/decoder.py:337](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/sajadi/anaconda3/envs/YOLOv8/01-HubUltralytics/~/anaconda3/envs/YOLOv8/lib/python3.10/json/decoder.py:337), in JSONDecoder.decode(self, s, _w)
    333 """Return the Python representation of ``s`` (a ``str`` instance
    334 containing a JSON document).
    335 
    336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    338 end = _w(s, end).end()

File [~/anaconda3/envs/YOLOv8/lib/python3.10/json/decoder.py:355](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/sajadi/anaconda3/envs/YOLOv8/01-HubUltralytics/~/anaconda3/envs/YOLOv8/lib/python3.10/json/decoder.py:355), in JSONDecoder.raw_decode(self, s, idx)
...
    973     # Catch JSON-related errors and raise as requests.JSONDecodeError
    974     # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
--> 975     raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

JSONDecodeError: Expecting value: line 2 column 1 (char 1)

colab:

hub.login('70e53a3ca9386b486074dd132ee540b326db4367fa')  # use your API key

model = YOLO('https://hub.ultralytics.com/models/tvIYOSDDUf4LHpp4Y9ZI')  # use your model URL
model.train()  # train model

Result:

Ultralytics HUB: Authenticated βœ…
Ultralytics HUB: View model at https://hub.ultralytics.com/models/tvIYOSDDUf4LHpp4Y9ZI πŸš€
Ultralytics YOLOv8.0.170 πŸš€ Python-3.10.12 torch-2.0.1+cu118 CUDA:0 (Tesla T4, 15102MiB)
engine/trainer: task=detect, mode=train, model=yolov8m.pt, data=Argoverse.yaml, epochs=100, patience=100, batch=-1, imgsz=640, save=True, save_period=-1, cache=ram, device=, workers=8, project=None, name=None, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, show=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, vid_stride=1, stream_buffer=False, line_width=None, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, boxes=True, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=False, opset=None, workspace=4, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, label_smoothing=0.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0, cfg=None, tracker=botsort.yaml, save_dir=runs/detect/train5

Dataset 'Argoverse.yaml' images not found ⚠️, missing path '/content/datasets/Argoverse/Argoverse-1.1/images/val'
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/ultralytics/engine/trainer.py](https://localhost:8080/#) in __init__(self, cfg, overrides, _callbacks)
    117             elif self.args.data.split('.')[-1] in ('yaml', 'yml') or self.args.task in ('detect', 'segment', 'pose'):
--> 118                 self.data = check_det_dataset(self.args.data)
    119                 if 'yaml_file' in self.data:

5 frames
<string> in <module>

TypeError: unsupported operand type(s) for /: 'PosixPath' and 'NoneType'

The above exception was the direct cause of the following exception:

RuntimeError                              Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/ultralytics/engine/trainer.py](https://localhost:8080/#) in __init__(self, cfg, overrides, _callbacks)
    120                     self.args.data = self.data['yaml_file']  # for validating 'yolo train data=url.zip' usage
    121         except Exception as e:
--> 122             raise RuntimeError(emojis(f"Dataset '{clean_url(self.args.data)}' error ❌ {e}")) from e
    123 
    124         self.trainset, self.testset = self.get_dataset(self.data)

RuntimeError: Dataset 'Argoverse.yaml' error ❌ unsupported operand type(s) for /: 'PosixPath' and 'NoneType'

Can you help me to solve this problem?

Environment

Minimal Reproducible Example

No response

Additional

No response

UltralyticsAssistant commented 1 year ago

@SMSajadi99 hello,

Thanks for reaching out and providing a detailed description of the issue you're facing.

From your Colab log, it seems there's a problem locating your 'Argoverse.yaml' dataset. When using the model.train() function, it requires access to the dataset specified in your YAML file. If the dataset is not available in the specified path, you will encounter the error message you've mentioned.

You have two options here:

  1. Make sure that the dataset path specified in the 'Argoverse.yaml' file is correct and that the necessary files are available in your environment.

  2. You can also upload your dataset directly onto the HUB using the hub.upload() function, which will ensure that it's easily accessible while training your model.

Regarding the traceback error seen in your local system, it appears to be a JSONDecodeError. This may be caused by an unsuccessful or malformed server response, or could also be related to the authentication process (hub.login()). Ensure your API key is valid, and if the issue persists, please provide us with more information about the error context so we could further assist you.

Remember to always safeguard your API key and not share it in any public forum, including on this GitHub platform.

Let us know how it goes or if you need further assistance!

Best, The Ultralytics Team

kalenmike commented 1 year ago

@SMSajadi99 Thanks for raising this. I will look into it now and see if we can see any issues. In the meantime I wanted to point out that you have shared your login details in your comment here which will make them publicly accessible.

SMSajadi99 commented 1 year ago

Hello again @kalenmike Yes, you are right that I should not publish my information I tried again based on whether to do it in colab or on the system, but it still gives the same errors

image image image

UltralyticsAssistant commented 1 year ago

Hi @SMSajadi99,

Sorry to hear that you're still facing this issue. From the screenshots provided, it seems that there might be some problem with your authentication process. Could you please check and confirm if the API key provided is valid? You can check this by logging into your account on our website and verifying the API key there. If your API key is correct, ensure that you're logged in before running any other code.

If your problem still persists, it's possible that we're looking at a network connection issue. Please ensure that your internet connection is stable.

For the error in your local system, it appears that your system is not able to find the file 'trainargoverse.yaml'. Could you please check and verify if the file is in the specified directory? The file path generally gets defined in the program before we call it. So, you need to ensure that you're providing the correct file path.

Let us know how it goes or if you need further assistance!

Best, The Ultralytics Team

github-actions[bot] commented 11 months ago

πŸ‘‹ Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO πŸš€ and Vision AI ⭐

SMSajadi99 commented 11 months ago

Hello @kalenmike I hope you are well, sorry for the delay in replying, I tried different internets, dns and vpn, but I still could not download. but now to find out what the problem is, I ran it in colab and I am sending you the video. thank you for your help.

https://github.com/ultralytics/hub/assets/69210109/30670bbb-5c4c-4fd7-a009-2197829a9346

UltralyticsAssistant commented 11 months ago

Hi @SMSajadi99,

Thank you for providing the video demonstrating the issue you're facing, that's very helpful.

From your description, it sounds like you've already tried multiple internet connections, DNS settings, and a VPN, but the download is still failing. Given this, it seems likely that the issue is not related to your network connection.

One possible explanation could be related to the specifics of the dataset you're trying to download and whether it's publicly available. Also, there could be some restrictions or limitations set by the provider of the dataset, causing the download to fail.

Without having more specific details about the error messages you're encountering, it's hard to determine the exact cause, but these are some possible scenarios to consider.

I hope this helps! Let us know if you continue experiencing difficulties or if you have more details to share.

Best,

The Ultralytics Team

SMSajadi99 commented 11 months ago

I have a free account and this dataset is publicly available, but I really can't download it If possible, you can also try with my api

kalenmike commented 11 months ago

@SMSajadi99 Thanks for the video. I can see from your video that the quota for downloading the Argoverse dataset has been exceeded. We provide a pass through to the dataset but do not host it ourselves.

We will look into what we can do to improve this. For the moment your only option is to download the dataset yourself manually and unzip into /content/datasets/Argoverse:

https://drive.google.com/file/d/1st9qW3BeIwQsnR0t8mRpvbsSWIo16ACi/view?usp=drive_link

SMSajadi99 commented 11 months ago

Hi @kalenmike I got it right. Thank you very much for your help and guidance Thank you for the link, I will definitely download it by the end of the night!

UltralyticsAssistant commented 11 months ago

Hi @SMSajadi99,

Great to hear that you found the information helpful! Your understanding and patience are very much appreciated. I'm glad you will attempt to download the dataset manually. This should provide a good workaround for the download issues you have been experiencing.

If you encounter any more issues or need further assistance, feel free to ask. We're here to help!

Best, The Ultralytics Team