我一直试图从项目https://github.com/amdegroot/ssd.pytorch.git运行固态硬盘的代码,但上面的错误不断弹出。我想可能是目录有问题。请指点一下!
我正在尝试导入以下文件,但无法导入
cannot import name 'BaseTransform' from 'data' (unknown location)当我尝试从上面的链接运行ssd python文件时,我得到了
ImportError: cannot import name 'voc' from 'data' (unknown location)所以我猜基本上是有一些路径问题。
import torch
from torch.autograd import Variable
import cv2
from data import BaseTransform, VOC_CLASSES as labelmap
from ssd import bulid_ssd
import imageio或者请告诉我,当数据和https://github.com/amdegroot/ssd.pytorch.git来自https://github.com/amdegroot/ssd.pytorch.git时,我应该将我的项目python文件和ssd文件放在哪个目录下才能使上述导入语句工作
PS:固态硬盘是单发MultiBox探测器,我用的是蟒蛇
发布于 2020-01-25 04:50:02
您将需要下载该项目,并且它应该有一个包含名称数据的文件夹,其中应该存在一个具有此名称的类。
structure your_file.py data |_ xxx.py示例
xxx.py代码示例
类BaseTransform: xxxxxx
https://stackoverflow.com/questions/57382368
复制相似问题