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

Issue with saving txt file #80

Open
zvonimirkonjevic opened this issue Mar 21, 2024 · 1 comment
Open

Issue with saving txt file #80

zvonimirkonjevic opened this issue Mar 21, 2024 · 1 comment

Comments

@zvonimirkonjevic
Copy link

I get following error when running script after having the path to coco.json file changed to path of my folder: FileNotFoundError: [Errno 2] No such file or directory: 'new_dir/labels/coco/data/video-GzdKTLbkG5F7gAunM-frame-000108-QHZmA4QTZCnzBG3HZ.txt'.

@glenn-jocher
Copy link
Member

@zvonimirkonjevic hello! 😊 It sounds like the directory you're trying to save your .txt files in doesn't exist. Ensure that the new_dir/labels/coco/data/ directory path is correctly created before attempting to save files there. You might need to check your script to ensure it's creating folders as expected. Here's a quick example on how to do this in Python:

import os
directory = "new_dir/labels/coco/data/"
if not os.path.exists(directory):
    os.makedirs(directory)

This code checks if the directory exists, and if not, it creates it for you. This should help avoid the FileNotFoundError. For more detailed guidelines, remember to check the Ultralytics Docs. Keep up the great work with your project!

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

No branches or pull requests

2 participants