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

requirements: /usr/src/requirements.txt not found, check failed. #11423

Closed
1 of 2 tasks
fo250061 opened this issue Apr 24, 2023 · 8 comments
Closed
1 of 2 tasks

requirements: /usr/src/requirements.txt not found, check failed. #11423

fo250061 opened this issue Apr 24, 2023 · 8 comments
Labels
bug Something isn't working Stale

Comments

@fo250061
Copy link

Search before asking

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

YOLOv5 Component

No response

Bug

I am using the image: docker pull ultralytics/yolov5:latest-arm64 as my base image and my docker file looks like this:

FROM ultralytics/yolov5:latest-arm64
# Copy the current directory contents into the container at /app
COPY . .
# Set the command to be run when the container starts
CMD ["python3", "app.py"]

To make things easy, my app only contains this line of code:

import os
import torch
from PIL import Image
import time
import json
import logging
import sys


def main():
    logging.info("Starting Detections...")
    model = torch.hub.load('.', 'custom', path='best.pt', source='local', force_reload=True)


if __name__ == "__main__":
    logging.basicConfig(
        stream=sys.stdout,
        level=logging.INFO,
        format="%(asctime)s %(levelname)-8s %(message)s",
        datefmt="%Y-%m-%d %H:%M:%S",
    )
    main()

Each time the model gets loaded, I get this message=> requirements: /usr/src/requirements.txt not found, check failed.

Environment

ultralytics/yolov5:latest-arm64

Minimal Reproducible Example

docker run

Additional

N/A

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@fo250061 fo250061 added the bug Something isn't working label Apr 24, 2023
@glenn-jocher
Copy link
Member

@fo250061 the message you are seeing is from PyTorch, not YOLOv5. It is warning you that it could not find the requirements.txt file usually used to track dependencies, but it is not necessary for this use case. You can safely ignore this warning.

Regarding the error message you mentioned in your previous comment, could you please provide more context or the actual error message in order for us to better assist you? You can also check out https://docs.ultralytics.com/yolov5/troubleshooting/ for common errors and their solutions.

@fo250061
Copy link
Author

docker run mycontainerimage:latest
2023-04-24 01:16:33 INFO Starting Detections...
2023-04-24 01:16:33 INFO generated new fontManager
YOLOv5 🚀 v7.0-153-gff6a9ac Python-3.10.7 torch-2.0.0 CPU

Fusing layers...
YOLOv5s summary: 157 layers, 7026307 parameters, 0 gradients, 15.8 GFLOPs
Adding AutoShape...
requirements: /usr/src/requirements.txt not found, check failed.

@glenn-jocher
Copy link
Member

@fo250061 It seem like you used the command torch.hub.load() to load a custom PyTorch object. The log that you provided appears normal and correct, so we suppose that the model was loaded successfully.

Regarding the warning message requirements: /usr/src/requirements.txt not found, check failed., as mentioned earlier, it is safe to ignore if your application does not have any further source code dependencies.

If you encountered any other issues or errors, please provide us with more information, such as the error message itself, in order for us to better assist you.

@fo250061
Copy link
Author

I loaded the weights (best.pt) that I trained. Everything works fine, just that I don't want to see that requirement's error message

@glenn-jocher
Copy link
Member

@fo250061, great to hear that everything is working fine!

If you prefer to not see the PyTorch warning message in the log, you can suppress it by adding the following code before your warning message appears:

import logging
# Add this line before the PyTorch log messages appear
logging.getLogger('yolov5').setLevel(logging.CRITICAL)

This will suppress the logging messages from PyTorch in the 'yolov5' logger. You can replace 'yolov5' with any other relevant logger name if needed.

Hope this helps!

@github-actions
Copy link
Contributor

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

@github-actions github-actions bot added the Stale label May 25, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2023
@sangship
Copy link

sangship commented Oct 6, 2024

몰라요

@pderrenger
Copy link
Member

@sangship i'm sorry, I can only assist in English. Could you please provide more details about your issue or question?

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

No branches or pull requests

4 participants