Call the weight file of yolov3 with OpenCV to obtain the names of the three scale output layers and report an error
ln = [ln[i[0] - 1] for i in net.getUnconnectedOutLayers()]
Error reporting
indexerror: invalid index to scalar variable
This code was a few years ago. It may be a problem with the version. Now it will report an error
Solution:
Remove [0] and modify as below:
ln = [ln[i - 1] for i in net.getUnconnectedOutLayers()]
Read More:
- [Solved] Cmake compile opencv open-source project Error: but it set OpenCV_FOUND to FALSE so package “OpenCV” is considered to be…
- Libtorch Error: Expected object of type Variable but found type CUDALongType for argument #2 ‘index’
- [Solved] Kafka Start Log Error: WARN Found a corrupted index file due to requirement failed: Corrupt index found
- [Solved] URIError: Failed to decode param ‘/%3C%=%20BASE_URL%20%3Estatic/index.%3C%=%20VUE_APP_INDEX_CSS_HASH%20%3E.css’
- How to Fix error: conversion from “” to non-scalar type “”
- [Solved] OpenCV error: #error “This header with legacy C API declarations has been removed from OpenCV.
- [Solved] Opencv3. X fatal error: opencv2/nonfree/nonfree.hpp: there is no such file or directory
- Opencv Can not Find opencv2/gpu/gpu.hpp [How to Solve]
- [Solved] Opencv Calls PB Model Error: cv2.error: OpenCV(4.2.0)…
- OpenCV VideoWriter Failed to Start [How to Solve]
- How to Solve Error: avoided redundant navigation to current location: “index/user”
- Angular_ Error: Cannot assign to a reference or variable!
- [Solved] At least one of these environment variable is needed to run this program
- CMake Error: The source directory “opencv Install Catalog“ does not appear to contain CMakeLists.txt.
- How to Solve Vector Variable Error in sub thread
- [Solved] SyntaxError: Invalid regular expression: invalid group specifier name
- [Solved] ORB_SLAM3 Compile Error: opencv4.0 not found four
- FailedPreconditionError (see above for traceback): Attempting to use uninitialized value Variable
- How to Solve OpenCV CVUI Error: LINK2019
- [Solved] Android DataBinding Error: java.lang.ArrayIndexOutOfBoundsException: length=2; index=2 fragment Changes to Fragm