这行代码在pycharm上运行,但不在Spyder上运行。由于此模块是由我的朋友制作的,因此我想集成到我的模块中。问题是同一模块在他的笔记本电脑上以相同的方式(Spyder)运行,而不是在我的模块上运行。 net = cv.dnn.readNetFromDarknet(modelConfiguration,modelWeights)行给出了错误。
classesFile = "det.names"
classes = None
with open(classesFile, 'rt') as f:
classes = f.read().rstrip('\n').split('\n')
modelConfiguration = "detect.cfg"
modelWeights = "code.weights"
net = cv.dnn.readNetFromDarknet(modelConfiguration, modelWeights)
net.setPreferableBackend(cv.dnn.DNN_BACKEND_OPENCV)
net.setPreferableTarget(cv.dnn.DNN_TARGET_CPU)
Help would be highly appreciable.