path fix for torch hub

pull/1/head
Lijun Yu 5 years ago
parent 4dd75b3635
commit 0dec8ffd66

@ -6,6 +6,9 @@ Usage:
""" """
dependencies = ['torch', 'yaml'] dependencies = ['torch', 'yaml']
import os
import torch import torch
from models.yolo import Model from models.yolo import Model
@ -24,7 +27,8 @@ def create(name, pretrained, channels, classes):
Returns: Returns:
pytorch model 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: if pretrained:
ckpt = '%s.pt' % name # checkpoint filename ckpt = '%s.pt' % name # checkpoint filename
google_utils.attempt_download(ckpt) # download if not found locally google_utils.attempt_download(ckpt) # download if not found locally

Loading…
Cancel
Save