darknet-ocr
darknet-ocr copied to clipboard
AttributeError: 'cv2.dnn_Net' object has no attribute 'getUnconnectedOutLayersNames'
AttributeError: 'cv2.dnn_Net' object has no attribute 'getUnconnectedOutLayersNames'
我自己测试替换获取输出层的名字的代码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()]换了就可以了,获取是那个版本太高造成的吧
按照requirements.txt去配置opencv
AttributeError: 'cv2.dnn_Net' object has no attribute 'getUconnectedOutLayersNames'