chineseocr / darknet-ocr

darknet text detect and darknet cnn ocr
MIT License
1.14k stars 285 forks source link

AttributeError: 'cv2.dnn_Net' object has no attribute 'getUnconnectedOutLayersNames' #6

Open yisampi opened 5 years ago

yisampi commented 5 years ago

AttributeError: 'cv2.dnn_Net' object has no attribute 'getUnconnectedOutLayersNames'

345334701 commented 5 years ago

我自己测试替换获取输出层的名字的代码net.getUnconnectedOutLayersNames(),用这个 def getOutputsNames(net):

Get the names of all the layers in the network

layersNames = net.getLayerNames()
# Get the names of the output layers, i.e. the layers with unconnected outputs
return [layersNames[i[0] - 1] for i in net.getUnconnectedOutLayers()]换了就可以了,获取是那个版本太高造成的吧
wenlihaoyu commented 5 years ago

按照requirements.txt去配置opencv

Kryptonite12 commented 4 years ago

AttributeError: 'cv2.dnn_Net' object has no attribute 'getUconnectedOutLayersNames'