报错大赏(9.11-9.18)

1. pytorch报错

(1) numpy.core._exceptions.UFuncTypeError: ufunc ‘add’ did not contain a loop with signature matching types (dtype(‘ dtype(‘

低级错误 字符串输出使用+串联

(2)IndexError: boolean index did not match indexed array along dimension 0; dimension is 6 but corresponding boolean dimension is 12

for i in range(nb):  # nb:number of batches
    ari = x[bi == i]

出问题的是上面这一句代码,其中x为列表,bi也为列表,在进行bool运算时x和bi的维度应该要相同

2 opencv

(2)cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\darknet\darknet_importer.cpp:210: error: (-212:Parsing error) Failed to open NetParameter file: ./yolo_coco/yolov3.cfg in function ‘cv::dnn::dnn4_v20220524::readNetFromDarknet’

使用opencv跑yolov3报了这个错,应该是路径问题,检查自己的yolov3.cfg和yolov3.weight路径

你可能感兴趣的:(#,pytorch快速开发与实战,python,opencv,开发语言)