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

Update requirements.txt to ultralytics 8.0.145 #11920

Merged
merged 1 commit into from
Jul 30, 2023

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Jul 30, 2023

πŸ€– Generated by Copilot at c023367

Summary

πŸ”§πŸššπŸ“¦

Refactored the ultralytics package to make it more modular and reusable, and moved utils/general.py to utils/__init__.py to simplify imports.

ultralytics splits
refactoring for reuse
autumn of code

Walkthrough

  • Refactor ultralytics package to make it more modular and reusable across different projects (link, link)
  • Move utils/general.py to utils/__init__.py and adjust imports accordingly (link)
  • Import check_requirements from ultralytics.utils instead of ultralytics.yolo.utils in notebook_init function (link)

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Update to dependency management and internal import paths.

πŸ“Š Key Changes

  • Updated the required version of the ultralytics package from 8.0.111 to 8.0.145 in requirements.txt.
  • Changed import paths for check_requirements from ultralytics.yolo.utils to ultralytics.utils in utils/__init__.py and utils/general.py.

🎯 Purpose & Impact

  • Ensuring compatibility with the latest ultralytics package by requiring a newer minimum version may incorporate bug fixes, performance improvements, or new features.
  • Refactoring the import paths for check_requirements helps maintain cleaner and more consistent code organization, reflecting an internal restructuring of the Ultralytics library.
  • These changes enhance the stability and maintainability of the YOLOv5 project, potentially resulting in a smoother experience for users.

@glenn-jocher glenn-jocher merged commit d43d876 into master Jul 30, 2023
10 checks passed
@glenn-jocher glenn-jocher deleted the requirements-update branch July 30, 2023 11:38
@aminrabinia
Copy link

aminrabinia commented Jul 31, 2023

Resolved with rebuild docker container.

File "/usr/src/app/./main.py", line 19, in
model = torch.hub.load(BASE_DIR, 'custom', path=MODEL_DIR, device='cpu', trust_repo=True)
File "/usr/local/lib/python3.8/dist-packages/torch/hub.py", line 542, in load
model = _load_local(repo_or_dir, model, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/torch/hub.py", line 572, in _load_local
model = entry(*args, **kwargs)
File "/home/.cache/torch/hub/ultralytics_yolov5_master/hubconf.py", line 83, in custom
return _create(path, autoshape=autoshape, verbose=_verbose, device=device)
File "/home/.cache/torch/hub/ultralytics_yolov5_master/hubconf.py", line 33, in _create
from models.common import AutoShape, DetectMultiBackend
File "/home/.cache/torch/hub/ultralytics_yolov5_master/models/common.py", line 28, in
from utils.dataloaders import exif_transpose, letterbox
File "/home/.cache/torch/hub/ultralytics_yolov5_master/utils/dataloaders.py", line 31, in
from utils.augmentations import (Albumentations, augment_hsv, classify_albumentations, classify_transforms, copy_paste,
File "/home/.cache/torch/hub/ultralytics_yolov5_master/utils/augmentations.py", line 15, in
from utils.general import LOGGER, check_version, colorstr, resample_segments, segment2box, xywhn2xyxy
File "/home/.cache/torch/hub/ultralytics_yolov5_master/utils/general.py", line 38, in
from ultralytics.utils.checks import check_requirements
ModuleNotFoundError: No module named 'ultralytics.utils'"

@glenn-jocher
Copy link
Member Author

@aminrabinia this issue seems to be caused by a missing module named 'ultralytics.utils'. One possible solution to resolve this error is to rebuild the Docker container. This can be done by running the necessary commands to recreate the container from the Dockerfile or using the appropriate tools or commands specific to the containerization platform being used.

Rebuilding the Docker container should ensure that all the required dependencies and modules are properly installed and accessible within the container environment. Once the container is rebuilt, the issue with the missing 'ultralytics.utils' module should be resolved.

Please try rebuilding the Docker container and let us know if the issue persists.

@aminrabinia
Copy link

Thanks. Rebuild fixed the error.

@glenn-jocher
Copy link
Member Author

@aminrabinia great to hear that rebuilding the Docker container solved the issue! If you have any further questions or run into any other problems, please don't hesitate to ask. The YOLOv5 community and the Ultralytics team are always here to help. Happy coding!

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

2 participants