导入错误:无法从"data"中导入名称"voc"(未知位置)

2024-10-01 15:48:21 发布

您现在位置:Python中文网/ 问答频道 /正文

我一直在尝试运行项目https://github.com/amdegroot/ssd.pytorch.git中的ssd代码 但上述错误不断出现。我想目录有点问题。请引导!!在

我正在尝试导入以下文件,但无法导入,并且

cannot import name 'BaseTransform' from 'data' (unknown location)

这就出现了 当我试图从上面的链接运行ssdpython文件时

^{pr2}$

所以基本上有一些路径问题。在

import torch
from torch.autograd import Variable
import cv2
from data import BaseTransform, VOC_CLASSES as labelmap
from ssd import bulid_ssd
import imageio

或者请告诉我,当数据和ssd来自https://github.com/amdegroot/ssd.pytorch.git时,我应该将项目python文件和https://github.com/amdegroot/ssd.pytorch.git文件放在哪个目录中才能使上述导入语句正常工作

附言:固态硬盘是单次发射多盒探测器,我使用的是Python


Tags: 文件项目fromhttpsimportgitgithub目录

热门问题