Closed matthewfranglen closed 4 years ago
Hello @matthewfranglen, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook , Docker Image, and Google Cloud Quickstart Guide for example environments.
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 model or data training question, please note that Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:
For more information please visit https://www.ultralytics.com.
@matthewfranglen this issue is not reproducible. Open a blank colab notebook, update pyyaml, restart and import the model. Everything works correctly here. If you are seeing errors you may want to delete the local cache that is being used and retry.
Deleting the cache file fixed the problem. Thank you for the speedy response.
@matthewfranglen yes, this is happening because the repo is changing fast, and we are introducing breaking changes in the process.
I wonder if we could wrap the entire hub loading function in a try except to notify future users to delete their cache when a failure occurs.
I think that would help a lot
All done. Relevant code wrapped in try except clause now. Seems like a great idea. https://github.com/ultralytics/yolov5/blob/a5818b280edcc983cb6bec626f36db50a5221f68/hubconf.py#L31-L43
Dear esteemed author: yeah i delete the cache ,however the commad continuning leave the error message Exception: Cache maybe be out of date, try force_reload=True. See https://docs.ultralytics.com/yolov5/tutorials/pytorch_hub_model_loading for help. I try to add the force_reload=True argument but still not work.Could u plz help me to find out the solution? Thanks
@hysaint YOLOv5 hub works correctly. Paste the following code into a new Colab notebook:
import torch
# Model
model = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True)
# Images
dir = 'https://github.com/ultralytics/yolov5/raw/master/data/images/'
imgs = [dir + f for f in ('zidane.jpg', 'bus.jpg')] # batched list of images
# Inference
results = model(imgs)
results.print() # or .show(), .save()
You'll see this:
@glenn-jocher very thankful .it works great
🐛 Bug
I cannot use your
hubconf.py
to load the model.To Reproduce (REQUIRED)
Input:
Output:
Expected behavior
The model should be created and the pretrained weights should be loaded.