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

User config prefixed by Path.home() breaks in AWS Lambda or any system without /home #4718

Closed
joaodiogocosta opened this issue Sep 9, 2021 · 3 comments · Fixed by #4727 or #4726
Closed
Labels
bug Something isn't working

Comments

@joaodiogocosta
Copy link
Contributor

🐛 Bug

This commit 8e94bf6 forces the user config dir to be inside /home/..., which is not compatible with AWS Lambda (only /tmp is writable).

I believe this should be configurable somehow so that the new user config dir can be set by the developer.

FileNotFoundError: [Errno 2] No such file or directory: '/home/sbx_user1051/.config/Ultralytics'
  File "lambda_function.py", line 44, in process_frames
    processing_context = FindObjects(processing_context).run()
  File "pyworker/models/mod/find_objects.py", line 15, in __init__
    self.model = object_detector()
  File "pyworker/models/ml_models.py", line 5, in object_detector
    return torch.hub.load('ultralytics/yolov5', 'custom', path=model_path)
  File "torch/hub.py", line 364, in load
    model = _load_local(repo_or_dir, model, *args, **kwargs)
  File "torch/hub.py", line 393, in _load_local
    model = entry(*args, **kwargs)
  File "/tmp/hub/ultralytics_yolov5_master/hubconf.py", line 70, in custom
    return _create(path, autoshape=autoshape, verbose=verbose, device=device)
  File "/tmp/hub/ultralytics_yolov5_master/hubconf.py", line 30, in _create
    from models.yolo import Model
  File "models/yolo.py", line 17, in <module>
    from models.common import *
  File "models/common.py", line 23, in <module>
    from utils.plots import Annotator, colors
  File "utils/plots.py", line 23, in <module>
    CONFIG_DIR = user_config_dir()  # Ultralytics settings dir
  File "utils/general.py", line 111, in user_config_dir
    path.mkdir()  # make dir if required
  File "pathlib.py", line 1288, in mkdir
    self._accessor.mkdir(self, mode)

Environment

  • AWS Lambda (Python)
@joaodiogocosta joaodiogocosta added the bug Something isn't working label Sep 9, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2021

👋 Hello @joaodiogocosta, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.

Requirements

Python>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

$ git clone https://github.com/ultralytics/yolov5
$ cd yolov5
$ pip install -r requirements.txt

Environments

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

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

@glenn-jocher
Copy link
Member

glenn-jocher commented Sep 9, 2021

@joaodiogocosta fixed in PRs #4726 and #4727, closing issue.

Thank you for your contributions and let us know if you run into any other issues!

@joaodiogocosta
Copy link
Contributor Author

Gotcha ✌️

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
2 participants