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

kaggle run yolov8 #1599

Closed
1 task done
wangtao0219 opened this issue Mar 24, 2023 · 7 comments
Closed
1 task done

kaggle run yolov8 #1599

wangtao0219 opened this issue Mar 24, 2023 · 7 comments
Labels
question Further information is requested

Comments

@wangtao0219
Copy link

Search before asking

Question

I have an awkward problem running YOLOv8 in kaggle. The kaggle dataset is stored in input, which is read-only.
But YOLOv8 needs to generate the train.cache file when run, which will cause an error, what can I do to run it properly

Additional

No response

@wangtao0219 wangtao0219 added the question Further information is requested label Mar 24, 2023
@github-actions
Copy link

github-actions bot commented Mar 24, 2023

👋 Hello @wangtao0219, thank you for your interest in YOLOv8 🚀! We recommend a visit to the YOLOv8 Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Install

Pip install the ultralytics package including all requirements.txt in a Python>=3.7 environment with PyTorch>=1.7.

pip install ultralytics

Environments

YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

Ultralytics CI

If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

@glenn-jocher
Copy link
Member

glenn-jocher commented Mar 24, 2023

@wangtao0219 👋 hi, thanks for letting us know about this possible problem with YOLO 🚀. YOLOv8 will not save cache files if directories are read-only. The code that handles this is here:

if is_dir_writeable(path.parent):
if path.exists():
path.unlink() # remove *.cache file if exists
np.save(str(path), x) # save cache for next time
path.with_suffix('.cache.npy').rename(path) # remove .npy suffix
LOGGER.info(f'{self.prefix}New cache created: {path}')
else:
LOGGER.warning(f'{self.prefix}WARNING ⚠️ Cache directory {path.parent} is not writeable, cache not saved.')

We've created a few short guidelines below to help users provide what we need in order to start investigating a possible problem.

How to create a Minimal, Reproducible Example

When asking a question, people will be better able to provide help if you provide code that they can easily understand and use to reproduce the problem. This is referred to by community members as creating a minimum reproducible example. Your code that reproduces the problem should be:

  • Minimal – Use as little code as possible to produce the problem
  • Complete – Provide all parts someone else needs to reproduce the problem
  • Reproducible – Test the code you're about to provide to make sure it reproduces the problem

For Ultralytics to provide assistance your code should also be:

  • Current – Verify that your code is up-to-date with GitHub with git pull or pip install -U ultralytics to ensure your problem has not already been solved in the latest code version.
  • Unmodified – Your problem must be reproducible using official Ultrlaytics code without changes. Ultralytics does not provide support for custom code ⚠️.

If you believe your problem meets all the above criteria, please close this issue and raise a new one using the 🐛 Bug Report template with a minimum reproducible example to help us better understand and diagnose your problem.

Thank you! 😃

@wangtao0219
Copy link
Author

@glenn-jocher Thank you for your reply, the problem is solved

@ManzarIMalik
Copy link

ManzarIMalik commented Jan 19, 2024

@glenn-jocher Thank you for your reply, the problem is solved

@wangtao0219, How did you resolved this issue in Kaggle?

@glenn-jocher
Copy link
Member

Great to hear your issue is resolved, @ManzarIMalik! If you have any more questions or run into any other issues, feel free to reach out. Happy coding with YOLOv8! 😊👍

@shreya123jadhav
Copy link

@glenn-jocher ,Even i have the same issue , and it is unresolved .

@glenn-jocher
Copy link
Member

@shreya123jadhav hello! To run YOLOv8 on Kaggle with a read-only dataset, you can specify a writable directory for the cache file. You can use the /kaggle/working directory, which is writable, to store your cache file. Here's how you can do it:

  1. Set the cache_dir argument in your dataset YAML file to /kaggle/working.
  2. When running YOLOv8, make sure to pass the modified dataset YAML file.

For example, if your dataset YAML is named dataset.yaml, modify it like this:

# dataset.yaml
train: /kaggle/input/your-dataset/train/images
val: /kaggle/input/your-dataset/val/images

# other settings...

cache_dir: /kaggle/working

Then, run YOLOv8 with this dataset YAML. This should allow YOLOv8 to generate the train.cache file in the writable /kaggle/working directory without any errors.

If you encounter any further issues or have additional questions, feel free to reach out! 😊👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants