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

File not found #527

Closed
1 task done
markatlarge opened this issue Jan 9, 2024 · 7 comments
Closed
1 task done

File not found #527

markatlarge opened this issue Jan 9, 2024 · 7 comments
Assignees
Labels
bug Something isn't working fixed Bug has been resolved

Comments

@markatlarge
Copy link

markatlarge commented Jan 9, 2024

Search before asking

Question

While training my model in the hub on that last epoch I got this error:

FileNotFoundError: [Errno 2] No such file or directory: 'runs/detect/train/weights/best.pt

If I look in the hub under the model you see the blue circle spinning even though I got the error message.

@markatlarge markatlarge added the question Further information is requested label Jan 9, 2024
Copy link

github-actions bot commented Jan 9, 2024

👋 Hello @markatlarge, thank you for raising an issue about Ultralytics HUB 🚀! Please visit our HUB Docs to learn more:

  • 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 improved 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 integration options for your trained models, such as TensorFlow, ONNX, OpenVINO, CoreML, and PaddlePaddle.
  • Ultralytics HUB App. Learn about the Ultralytics App for iOS and Android, which allows you to run models directly on your mobile device.
    • iOS. Learn about YOLO CoreML models accelerated on Apple's Neural Engine on iPhones and iPads.
    • Android. Explore TFLite acceleration on mobile devices.
  • Inference API. Understand how to use the Inference API for running your trained models in the cloud to generate predictions.

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!

@UltralyticsAssistant
Copy link
Member

@markatlarge hello! I'm sorry to hear you're encountering a FileNotFoundError during your model training on the Ultralytics HUB. It seems like the training process is trying to access the 'best.pt' file, which should contain the weights of the best-performing model, but it's not found in the expected directory.

This could be due to a few reasons, such as the file not being saved correctly, or an issue with the path configuration. Here's what you can do:

  1. Check the Training Configuration: Ensure that the output directory is set correctly and that the process has the necessary permissions to write to that directory.
  2. Inspect the Output Directory: Manually check the specified directory to see if the 'best.pt' file exists. It's possible that the file might be in a different location.
  3. Review the Training Logs: Look through the training logs for any indications of why the file wasn't saved or if there were any errors during the saving process.
  4. Training Interruption: If the training was interrupted or didn't complete successfully, the 'best.pt' file might not have been created.

If the issue persists, please provide additional details about your training setup and any steps you've already taken to troubleshoot the problem. This will help us assist you more effectively.

For further guidance, you can refer to the Ultralytics HUB Docs, which might have additional troubleshooting steps or relevant information.

We appreciate your patience and are here to help you get back on track with your training! 🚀

@markatlarge
Copy link
Author

@UltralyticsAssistant

I was using Ultralytics HUB,

This is the code i executed with my information in colabs
hub.login('API_KEY') # use your API key

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

its looking at the "https://hub.ultralytics.com/MODEL_ID" to find the last.pt and it can not.

Is there away in the UI i can check or some other way in the colabs note book. Here is the error message when I execute the code:
Ultralytics HUB: New authentication successful ✅

TypeError Traceback (most recent call last)
in <cell line: 3>()
1 hub.login('ce0c9365d1d98f8f928166db59f301dbcae09f190b')
2
----> 3 model = YOLO('https://hub.ultralytics.com/models/pf4EK86gcHR9864jfOPr')
4
5

5 frames
/usr/local/lib/python3.10/dist-packages/hub_sdk/modules/models.py in get_weights_url(self, weight)
204 """
205 if weight == "last":
--> 206 return self.data("resume")
207
208 return self.data.get("weights")

TypeError: 'dict' object is not callable

@UltralyticsAssistant
Copy link
Member

Hello @markatlarge! It looks like you're experiencing a TypeError when attempting to access the model weights using the Ultralytics HUB SDK in your Colab notebook. The error message indicates that there's an issue with the way the SDK is trying to call the data attribute of the model object.

The data attribute should contain a dictionary with information about the model, but the error suggests that the code is trying to use it as a callable function, which is not correct.

To resolve this, please ensure that you are using the latest version of the Ultralytics HUB SDK, as there might have been updates or bug fixes since you last installed it. If the issue persists after updating, it could be a bug within the SDK itself.

In the meantime, you can try the following steps to troubleshoot:

  1. Check SDK Version: Make sure you have the latest version of the Ultralytics HUB SDK installed in your Colab environment.
  2. Review Documentation: Double-check the SDK usage in the Ultralytics HUB Docs to ensure you're using the functions correctly.
  3. Error Message: The error message indicates a problem with the get_weights_url method. Without modifying the SDK code, there's not much you can do to fix this directly.

If you're still facing issues, I recommend reporting this error on the Ultralytics HUB GitHub repository with the details you've provided here. The development team will be able to investigate the issue further and provide a fix or guidance on how to proceed.

We appreciate your understanding and are committed to helping you resolve this issue. Thank you for bringing this to our attention! 🛠️

@markatlarge
Copy link
Author

@UltralyticsAssistant - In order to train the model I go into the hub, copy the code and go to the colabs note book link in the hub:

In the note book I run this to install Ultralytics

%pip install ultralytics # install
from ultralytics import YOLO, checks, hub
checks() # checks

The version is indicated aa: Ultralytics YOLOv8.1.0.

Ill crate this as a issue

@UltralyticsAssistant
Copy link
Member

Thank you for the update, @markatlarge. It's good to hear that you're using the latest version of the Ultralytics YOLOv8.1.0. Since you're still encountering the issue, creating an issue on the Ultralytics HUB GitHub repository is indeed the right course of action. The development team will be able to take a closer look at the problem and work on a resolution.

When you create the issue, please include all the relevant details such as the error message, the steps you've taken, and the version of the SDK you're using. This information will be very helpful for the developers to understand and replicate the issue.

We appreciate your cooperation and patience as we work to resolve this. Your contributions help improve the experience for the entire YOLO community. Thank you for your support! 🌟

@kalenmike
Copy link
Contributor

@markatlarge I don't have enough information to confirm what your initial error was, but the second error relating to resume is due to a bug we introduced in the last hub-sdk. This has been patched:

#529

@kalenmike kalenmike added bug Something isn't working fixed Bug has been resolved and removed question Further information is requested labels Jan 11, 2024
@kalenmike kalenmike self-assigned this Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Bug has been resolved
Projects
None yet
Development

No branches or pull requests

3 participants