ValueError: too many values to unpack (expected 2) while trying to load yolov5 model
I am trying to load a trained yolov5 model on a custom dataset using this:
# Model
model = torch.hub.load('/home/yolov5/runs/train/yolo_sign_det2/weights', 'best')  # or yolov5n - yolov5x6, custom


but I am running into this error:
ValueError                                Traceback (most recent call last)
&lt;ipython-input-3-c832ab8c1eab&gt; in &lt;module&gt;
      2 
      3 # Model
----&gt; 4 model = torch.hub.load('/home/yolov5/runs/train/yolo_sign_det2/weights', 'best')  # or yolov5n - yolov5x6, custom
      5 
      6 # Images

~/.conda/envs/yolo/lib/python3.6/site-packages/torch/hub.py in load(repo_or_dir, model, source, force_reload, verbose, skip_validation, *args, **kwargs)
    395 
    396     if source == 'github':
--&gt; 397         repo_or_dir = _get_cache_or_reload(repo_or_dir, force_reload, verbose, skip_validation)
    398 
    399     model = _load_local(repo_or_dir, model, *args, **kwargs)

~/.conda/envs/yolo/lib/python3.6/site-packages/torch/hub.py in _get_cache_or_reload(github, force_reload, verbose, skip_validation)
    163         os.makedirs(hub_dir)
    164     # Parse github repo information
--&gt; 165     repo_owner, repo_name, branch = _parse_repo_info(github)
    166     # Github allows branch name with slash '/',
    167     # this causes confusion with path on both Linux and Windows.

~/.conda/envs/yolo/lib/python3.6/site-packages/torch/hub.py in _parse_repo_info(github)
    110     else:
    111         repo_info, branch = github, None
--&gt; 112     repo_owner, repo_name = repo_info.split('/')
    113 
    114     if branch is None:

ValueError: too many values to unpack (expected 2)

Can anybody please tell what I'm doing wrong?

From the Pytorch documentation website, it seems that the source option is set to github by default so your line of code:
model = torch.hub.load('/home/yolov5/runs/train/yolo_sign_det2/weights', 'best')  # or yolov5n - yolov5x6, custom

actually means:
model = torch.hub.load('/home/yolov5/runs/train/yolo_sign_det2/weights', 'best', source='github')  # or yolov5n - yolov5x6, custom

Thus, you need to set source=local as explained in the linked documentation, by keeping source='github' it means your programme is trying to find a GitHub repository (as can be seen in your error messages).
The fix is to use this line of code instead with the source set to local:
torch.hub.load('/home/yolov5/runs/train/yolo_sign_det2/weights', 'best', source='local')

