如何编辑已安装的包然后构建另一个包? Python火炬视觉

问题描述

我已经安装了torchvision包并编辑了Re​​tinanet模型的源代码来做多标签对象检测。 我的问题是,我将retinanet.py 复制到我的'networks' 包中,并想构建我自己的包。但我不知道该怎么做。

网络结构:

networks--
        --__init__.py
        --model.py
        --networks.py
        --nms.pyx
        --retinant.py

在retinant.py中,它导入了一些带有相对路径的包,我该如何处理?

import math
from collections import OrderedDict
import warnings

import torch
from torch import nn,Tensor
from typing import Dict,List,Tuple,Optional

from ._utils import overwrite_eps
from ..utils import load_state_dict_from_url

from . import _utils as det_utils
from .anchor_utils import AnchorGenerator
from .transform import GeneralizedRCNNTransform
from .backbone_utils import resnet_fpn_backbone,_validate_trainable_layers
from ...ops.feature_pyramid_network import LastLevelP6P7
from ...ops import sigmoid_focal_loss
from ...ops import Boxes as Box_ops
import numpy as np
import networks
from networks import nms

提前致谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)