提交 0dec8ffd authored 作者: Lijun Yu's avatar Lijun Yu

path fix for torch hub

上级 4dd75b36
...@@ -6,6 +6,9 @@ Usage: ...@@ -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): ...@@ -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
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论