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

ImportError: cannot import name 'secure filename' from 'utils’ (E:(haut_ codelyoL0v5-flask-masterlutils__init__.py #13442

Open
2 tasks done
serbbda opened this issue Dec 5, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@serbbda
Copy link

serbbda commented Dec 5, 2024

Search before asking

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

YOLOv5 Component

No response

Bug

ImportError: cannot import name 'secure filename' from 'utils’ (E:(haut_ codelyoL0v5-flask-masterlutils__init__.py

Environment

OS:pycharm,windows

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@serbbda serbbda added the bug Something isn't working label Dec 5, 2024
@UltralyticsAssistant
Copy link
Member

👋 Hello @serbbda, thank you for your interest in YOLOv5 🚀! It looks like you're encountering an ImportError.

If this is a 🐛 Bug Report, could you please provide a minimum reproducible example to help us debug it? This includes code snippets, the exact steps you're taking, and any additional details about the error you're experiencing.

If this is a custom training ❓ Question, please include more information such as dataset examples, training logs, and ensure you're following recommended practices for training YOLOv5 models.

Requirements

Ensure you are using Python>=3.8.0 with all required dependencies installed. You can verify this by setting up your environment from the repository and running the commands:

git clone the repository  # clone
cd yolov5
pip install -r requirements.txt  # install dependencies

Environments

YOLOv5 can be run in numerous environments, including local machines, cloud platforms, and Docker containers. It’s important to have all dependencies up-to-date, including Python, PyTorch, CUDA, and CUDNN.

Status

If all repository tests are passing, the issue might be related to your specific setup or configuration. Please include more detailed logs or context for further assistance.

This is an automated response to guide you, but an Ultralytics engineer will review your issue and provide additional support soon 🙂

@serbbda
Copy link
Author

serbbda commented Dec 5, 2024

Thanks a lot。
How can I solve this problem?
ImportError: cannot import name 'secure filename' from 'utils’ (E:(haut_ codelyoL0v5-flask-masterlutils__init__.py)
Thanks very much for your reply

@pderrenger
Copy link
Member

@serbbda the error suggests that the import of secure_filename is failing because it's not part of YOLOv5's utils module. This function is typically part of Flask (from werkzeug.utils import secure_filename). Verify and replace the import with from werkzeug.utils import secure_filename in your code. Let me know if you face further issues!

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

No branches or pull requests

3 participants