Pārlūkot izejas kodu

path fix for torch hub

5.0
Lijun Yu pirms 4 gadiem
vecāks
revīzija
0dec8ffd66
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. +5
    -1
      hubconf.py

+ 5
- 1
hubconf.py Parādīt failu

@@ -6,6 +6,9 @@ Usage:
"""

dependencies = ['torch', 'yaml']

import os

import torch

from models.yolo import Model
@@ -24,7 +27,8 @@ def create(name, pretrained, channels, classes):
Returns:
pytorch model
"""
model = Model('models/%s.yaml' % name, channels, classes)
config = os.path.join(os.path.dirname(__file__), 'models', '%s.yaml' % name)
model = Model(config, channels, classes)
if pretrained:
ckpt = '%s.pt' % name # checkpoint filename
google_utils.attempt_download(ckpt) # download if not found locally

Notiek ielāde…
Atcelt
Saglabāt