How to use hub if don't have network?
Skypow2012 opened this issue · 2 comments
Downloading: "https://github.com/ultralytics/yolov5/archive/master.zip" to /root/.cache/torch/hub/master.zip
I always stop in last line.
Is there anyway to use hub offline.
Hi @Skypow2012 , do you have an example of the code that you're trying to run? It's not clear what you want to do from the current description.
If what you're trying to do is use torch.hub.load
offline, you can try setting the source
parameter to a path that points to the corresponding repo (please refer to our docs https://pytorch.org/docs/stable/hub.html). HTH
https://github.com/pytorch/pytorch/blob/577a4d34a7c017bf57b997967bf965255fd61909/torch/hub.py#L393
ok, I find this config, thanks for your reply~
model = torch.hub.load('/root/.cache/torch/hub/ultralytics_yolov5_master/', 'custom', path='./best.pt', source='local')
Last code can now fix my issue, thanks NicolasHug, thanks torch.hub and thanks yolov5~