繁体   English   中英

(-2:未指定的错误)无法在 function 'getLayerInstance' 中创建类型为“AddV2”的图层“FeatureExtractor/Mobil.netV3/Conv/hard_swish/add”

[英](-2:Unspecified error) Can't create layer "FeatureExtractor/MobilenetV3/Conv/hard_swish/add" of type "AddV2" in function 'getLayerInstance'

我在classIds, confs, bbox =.net.detect(img,confThreshold=float0.5)中遇到问题如何解决?请帮助。

我正在尝试运行一个非常简单的 OpenCV 脚本:

import cv2

img = cv2.imread("index.jpeg")

classNames= []
classFile = 'coco.names'
with open(classFile,'rt') as f:
    classNames = f.read().rstrip('\n').split('\n')

configPath = "ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt"
weightsPath = "frozen_inference_graph.pb"

net = cv2.dnn_DetectionModel(weightsPath,configPath)
net.setInputSize(320,320)
net.setInputScale(1.0/ 127.5)
net.setInputMean((127.5, 127.5, 127.5))
net.setInputSwapRB(True)

classIds, confs, bbox = net.detect(img,confThreshold=0.5) #line 19
print(classIds,bbox)


cv2.imshow("Output",img)
cv2.waitKey(0)

完整错误图片

提前致谢!

我认为需要将您的 opencv 版本升级到 4.5 及更高版本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM