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

Fix from yolov5 import utils statement #7578

Merged
merged 1 commit into from
Apr 26, 2022

Conversation

Jack24658735
Copy link
Contributor

@Jack24658735 Jack24658735 commented Apr 25, 2022

Hi,
I ran the tutorial.ipynb in the repo. Then, I found the original import statement from yolov5 import utils could report error message ModuleNotFoundError: No module named 'yolov5'. So, I think it should be revised to import utils to work properly.
Please check whether it's a bug, thanks!

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Refinement of the YOLOv5 tutorial notebook's import statements.

📊 Key Changes

  • Updated the import statement for utils in the YOLOv5 tutorial notebook.

🎯 Purpose & Impact

  • Ensures consistency in how utility functions are imported within the notebook.
  • Likely to prevent confusion or errors caused by potential namespace issues.
  • Benefits users by providing a clearer example of how to properly import and use utility functions in their own YOLOv5 projects. ☀️

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 Hello @Jack24658735, thank you for submitting a YOLOv5 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • ✅ Verify your PR is up-to-date with upstream/master. If your PR is behind upstream/master an automatic GitHub Actions merge may be attempted by writing /rebase in a new comment, or by running the following code, replacing 'feature' with the name of your local branch:
git remote add upstream https://github.com/ultralytics/yolov5.git
git fetch upstream
# git checkout feature  # <--- replace 'feature' with local branch name
git merge upstream/master
git push -u origin -f
  • ✅ Verify all Continuous Integration (CI) checks are passing.
  • ✅ Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." -Bruce Lee

@lyhsieh
Copy link

lyhsieh commented Apr 25, 2022

It results in an error, actually. It's a good question food for thought.

@glenn-jocher
Copy link
Member

@Jack24658735 @LeoTheBestCoder that's strange, in the past I had the import structured this way because Colab would error any other way. Now I test the change and both current and PR work equally well. Maybe there was a bug in Colab earlier that prevented imports from respecting the earlier %cd yolov5 working directory change.

@Jack24658735
Copy link
Contributor Author

Jack24658735 commented Apr 25, 2022

@glenn-jocher Hi, I ran it on Colab and it matched your situation. Since I'm running in my PC with anaconda environment, it seems to only the import utils could work well. Also I ran the .ipynb in my virtual machine (Linux) locally, and it obtains the same result. Could you test it locally? Thanks~

@glenn-jocher
Copy link
Member

@LeoTheBestCoder what environment are you seeing the PR produce an error in?

@lyhsieh
Copy link

lyhsieh commented Apr 26, 2022

I ran the program in Ubuntu 18.04, and I encountered the same error as @Jack24658735 did.

@glenn-jocher glenn-jocher changed the title Fix import statement about yolov5 Fix from yolov5 import utils statement Apr 26, 2022
@glenn-jocher
Copy link
Member

@LeoTheBestCoder got it, thanks for the feedback!

@glenn-jocher glenn-jocher merged commit 2611477 into ultralytics:master Apr 26, 2022
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants