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

deploy quesion #944

Open
1 task done
sjocnjfjd opened this issue Dec 6, 2024 · 10 comments
Open
1 task done

deploy quesion #944

sjocnjfjd opened this issue Dec 6, 2024 · 10 comments
Labels
bug Something isn't working info needed More information is required to proceed

Comments

@sjocnjfjd
Copy link

Search before asking

  • I have searched the HUB issues and found no similar bug report.

HUB Component

No response

Bug

100 epochs completed in 0.142 hours.
Optimizer stripped from runs/detect/train/weights/last.pt, 5.5MB
Optimizer stripped from runs/detect/train/weights/best.pt, 5.5MB

Validating runs/detect/train/weights/best.pt...
Ultralytics 8.3.44 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)
YOLO11n summary (fused): 238 layers, 2,582,347 parameters, 0 gradients, 6.3 GFLOPs
FileNotFoundError Traceback (most recent call last)
in <cell line: 4>()
2
3 model = YOLO('https://hub.ultralytics.com/models/Lcn7iZIH2yxgTClirLcl')
----> 4 results = model.train(data='/datasets/a2O66UeTvAEqSUPPff6l/lane/lane.yaml', project='runs/train', name='exp', epochs=100)

6 frames
/usr/local/lib/python3.10/dist-packages/ultralytics/data/utils.py in check_det_dataset(dataset, autodownload)
327 else:
328 m += f"\nNote dataset download directory is '{DATASETS_DIR}'. You can update this in '{SETTINGS_FILE}'"
--> 329 raise FileNotFoundError(m)
330 t = time.time()
331 r = None # success

FileNotFoundError:
Dataset '/content/datasets/lane/lane.yaml' images not found ⚠️, missing path '/content/datasets/D:python新/建文件夹 (2)/hakusenninnshiki.v2i.yolov11/lane.yaml/images/val'
Note dataset download directory is '/content/datasets'. You can update this in '/root/.config/Ultralytics/settings.json'
why does this always come up

Environment

computer window :https://hub.ultralytics.com/models/Lcn7iZIH2yxgTClirLcl?tab=deploy

Minimal Reproducible Example

no

Additional

no

@sjocnjfjd sjocnjfjd added the bug Something isn't working label Dec 6, 2024
@UltralyticsAssistant UltralyticsAssistant added the info needed More information is required to proceed label Dec 6, 2024
@UltralyticsAssistant
Copy link
Member

👋 Hello @sjocnjfjd, thank you for raising this issue about the Ultralytics HUB 🚀! Your feedback is greatly appreciated. Please visit our HUB Docs for in-depth information and guidance:

  • Quickstart. Start training and deploying YOLO models with HUB in seconds.
  • Datasets: Preparing and Uploading. Learn how to prepare and upload your datasets to HUB in YOLO format.
  • Projects: Creating and Managing. Group your models into projects for better organization.
  • Models: Training and Exporting. Train YOLOv5 and YOLOv8 models on your custom datasets and export them to various formats for deployment.
  • Integrations. Explore different model integration options, such as TensorFlow, ONNX, OpenVINO, CoreML, and PaddlePaddle.
  • Ultralytics HUB App. Learn how to use the Ultralytics App for iOS and Android to run models directly on mobile devices.
    • iOS. Understand how to leverage YOLO CoreML models on iPhones and iPads.
    • Android. Explore TFLite acceleration on Android devices.
  • Inference API. Use the Inference API to run your trained models in the cloud and generate predictions.

🐛 Bug Report

It seems you're encountering a FileNotFoundError related to a missing dataset path. To help us identify and resolve the issue efficiently, could you please share a Minimal Reproducible Example (MRE)? This includes:

  1. The exact code snippet you are running.
  2. Steps to reproduce the error, including how your dataset is structured and any relevant file paths or settings.
  3. Screenshots or additional logs if applicable.

You can refer to minimum reproducible example for guidance on creating one.

Additional Suggestions

Based on the error, it looks like the dataset path '/content/datasets/lane/lane.yaml' is incorrect or missing required files (e.g., images/val directory). Please ensure that your dataset is correctly formatted and accessible at the specified location. For further assistance, you can also review our documentation on preparing datasets.

This is an automated response to acknowledge your issue submission. An Ultralytics engineer will review your report shortly and provide further assistance. Thank you for your patience! 😊

@sjocnjfjd
Copy link
Author

hub.login('bc75bde9b0e4c78e5b1570cbc1bccdb5a63db0bdd0')

model = YOLO('https://hub.ultralytics.com/models/Lcn7iZIH2yxgTClirLcl')
results = model.train(data='/datasets/a2O66UeTvAEqSUPPff6l/lane/lane.yaml', project='runs/train', name='exp', epochs=100)
微信截图_20241206231349
微信截图_20241206231404

@sjocnjfjd
Copy link
Author

and this site is shoeing that I have uploaded the data set correctly

@sjocnjfjd
Copy link
Author

Uploading 微信截图_20241206232011.png…

@sjocnjfjd
Copy link
Author

微信截图_20241206232011

@sjocnjfjd
Copy link
Author

why donot you write back

@pderrenger
Copy link
Member

Hello, thanks for reaching out!

From your earlier messages, it seems like your training process is raising a FileNotFoundError because the dataset specified in your lane.yaml file is not being correctly located during model training. While you're seeing the dataset uploaded correctly in Ultralytics HUB, there may be an issue with the file paths used in your local lane.yaml configuration or how you're referencing the dataset in the code.

Here are the steps you can follow to troubleshoot and resolve the issue:


1. Verify Dataset Paths in the lane.yaml

Check the train, val, and other relevant paths inside your lane.yaml file. Based on the error provided, YOLO is expecting the validation images at:
/content/datasets/D:python新/建文件夹 (2)/hakusenninnshiki.v2i.yolov11/lane.yaml/images/val.

This file path seems mismatched. If this dataset was uploaded through HUB, it is recommended to use the dataset directly from HUB by referencing its unique ID. This ensures seamless integration when training models.


2. Update Your hub.login and Dataset Call

HUB handles dataset pathing automatically, so you may need to adjust your workflow by linking the dataset in HUB explicitly instead of using a local filepath. For example, try:

# Log in to HUB and retrieve the correct dataset
from ultralytics import hub, YOLO

hub.login("your_hub_api_key")
model = YOLO('https://hub.ultralytics.com/models/Lcn7iZIH2yxgTClirLcl')

# Use HUB dataset ID directly
results = model.train(data='https://hub.ultralytics.com/datasets/your_dataset_id',
                      project='runs/train',
                      name='exp',
                      epochs=100)

Replace your_dataset_id with the unique dataset ID provided in your Ultralytics HUB console.


3. Test Using Local Paths

If you intend to use datasets stored locally, ensure that you adjust to absolute paths and confirm the folder structure matches the expectations in your lane.yaml. As an example:

train: /content/datasets/lane/images/train  # Adjust to absolute path
val: /content/datasets/lane/images/val
nc: 2  # Number of classes
names: ['class1', 'class2']

Run again with these paths properly set.


4. Final Suggestions for Troubleshooting

If none of these methods resolve the issue:

  • Update to the latest Ultralytics YOLO version to ensure any potential bugs are fixed.
  • Double-check the dataset structure in your HUB workspace under Datasets.
  • Reference the step-by-step dataset preparation guide here: Ultralytics HUB Datasets.

If you still encounter issues, feel free to share additional information such as your lane.yaml file configuration (excluding sensitive content) or screenshots of your dataset setup in HUB. We're happy to assist further!

Let us know how it goes! 😊

@sjocnjfjd
Copy link
Author

sjocnjfjd commented Dec 7, 2024 via email

@sjocnjfjd
Copy link
Author

100 epochs completed in 0.151 hours.
Optimizer stripped from runs/detect/train/weights/last.pt, 5.5MB
Optimizer stripped from runs/detect/train/weights/best.pt, 5.5MB

Validating runs/detect/train/weights/best.pt...
Ultralytics 8.3.47 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)
YOLO11n summary (fused): 238 layers, 2,582,347 parameters, 0 gradients, 6.3 GFLOPs
FileNotFoundError Traceback (most recent call last)
in <cell line: 4>()
2
3 model = YOLO('https://hub.ultralytics.com/models/CakR19gXMlXaHJwZM1PX')
----> 4 results = model.train()

6 frames
/usr/local/lib/python3.10/dist-packages/ultralytics/data/utils.py in check_det_dataset(dataset, autodownload)
327 else:
328 m += f"\nNote dataset download directory is '{DATASETS_DIR}'. You can update this in '{SETTINGS_FILE}'"
--> 329 raise FileNotFoundError(m)
330 t = time.time()
331 r = None # success

FileNotFoundError:
Dataset '/content/datasets/lane/lane.yaml' images not found ⚠️, missing path '/datasets/a2O66UeTvAEqSUPPff6l/lane/lane.yaml/images/val'
Note dataset download directory is '/content/datasets'. You can update this in '/root/.config/Ultralytics/settings.json'
why still cannot find it,but Iwas successful with your existing data set?

@pderrenger
Copy link
Member

Thank you for your detailed feedback! It looks like the issue is related to how the dataset paths are being referenced when training your model using your uploaded dataset in the Ultralytics HUB. The fact that the training works fine with existing sample datasets from the HUB but fails with custom datasets suggests a potential misconfiguration in how your dataset is structured or linked.

Here’s how you can troubleshoot and resolve this:


1. Double-Check Dataset Structure in HUB

Since you are using a dataset uploaded to HUB, ensure the dataset is structured properly in your YAML file (e.g., lane.yaml) and that the paths for train, val, and test point to the correct relative or absolute directories. HUB handles dataset integration efficiently, so using HUB datasets typically looks like this:

# Example YAML file structure:
names: ['class1', 'class2']  # Specify class names
nc: 2                        # Number of classes

train: images/train          # Automatically managed by HUB
val: images/val

When working with datasets from HUB, these paths are handled internally by HUB. Ensure you reference the dataset correctly through its ID in your script rather than using local paths.


2. Use Dataset ID from HUB

When your dataset is uploaded and available in the HUB, your workflow should avoid hardcoding local paths. Instead, use the dataset's unique HUB ID for seamless integration. For instance:

from ultralytics import hub, YOLO

# Authenticate with your HUB API key
hub.login('your_hub_api_key')

# Load the model and dataset from HUB
model = YOLO('https://hub.ultralytics.com/models/CakR19gXMlXaHJwZM1PX')
results = model.train(data='https://hub.ultralytics.com/datasets/YOUR_DATASET_ID',
                      project='runs/train',
                      name='exp',
                      epochs=100)
  • Replace YOUR_DATASET_ID with the unique ID of your dataset, visible in your HUB account.

3. Verify Dataset Setup in HUB

Go to your HUB workspace and ensure:

  1. Your dataset is successfully uploaded and appears under the Datasets section.
  2. The dataset preview shows a valid split between train and val image directories. Click into the dataset in HUB to verify that the images/val directory contains images and that annotations are present.

If the dataset does not display correctly in HUB, re-upload the dataset as outlined in the Ultralytics HUB Datasets Guide.


4. Debug Dataset Path Issues

If you continue to encounter FileNotFoundError, it could mean your dataset was not linked properly. Try downloading your HUB-hosted dataset and verifying its structure locally:

# Example of local download for verification
dataset = hub.download_dataset('YOUR_DATASET_ID')  # Replace with your dataset ID
print(f"Dataset downloaded to: {dataset}")

Once the dataset is downloaded, check if:

  • The images/train and images/val directories exist.
  • The lane.yaml file lists paths relative to the dataset directory or as absolute paths accessible from your working environment.

5. Update YOLO Library to the Latest Version

If an issue persists, confirm that you are using the latest Ultralytics library, as updates often fix bugs or compatibility issues. Upgrade as follows:

pip install ultralytics --upgrade

Summary

  • Use the dataset's unique ID in HUB rather than specifying local paths manually.
  • Verify the dataset structure in both HUB and locally (if downloaded).
  • Ensure your lane.yaml configuration matches the dataset structure and references correct paths.

If you've confirmed the dataset is correct and the issue persists, let us know more details (like the exact dataset ID or screenshots of the dataset structure in HUB if possible). We’ll gladly assist further! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working info needed More information is required to proceed
Projects
None yet
Development

No branches or pull requests

3 participants