IndexError: list index out of range
When training ctpn, some pictures report this error
the error code is as follows. Because the mean value is subtracted from three channels respectively when subtracting the mean value, some pictures are of two channels, and the length does not match, so an error is reported
solution: convert to RGB three channel diagram here
vggMeans = [122.7717, 102.9801, 115.9465]
imageList = cv2.split(image.astype(np.float32))
imageList[0] = imageList[0]-vggMeans[0]
imageList[1] = imageList[1]-vggMeans[1]
imageList[2] = imageList[2]-vggMeans[2]
image = cv2.merge(imageList)
Read More:
- Xpath Error: IndexError: list index out of range [How to Solve]
- [Solved] yolo Error: IndexError: invalid index to scalar variable.
- Python IndexError: too many indices for array: array is 1-dimensional, but 2 were i..
- [Solved] theano-GPU Error: pygpu.gpuarray.GpuArrayException: b‘cuMemAlloc: CUDA_ERROR_OUT_OF_MEMORY: out of memory
- The range of Chinese Unicode encoding and the calculation of the number of Chinese and English words in text
- [Exception]’ascii’ codec can’t decode byte 0xe8 in position 2: ordinal not in range(128)
- Panda error in modifying line name index does not support mutable operations
- [Solved] ValueError: row index was 65536, not allowed by .xls format
- [Solved] RuntimeError: gather(): Expected dtype int64 for index
- Solve the error of panda index unalignable Boolean series provided as indexer
- [Solved] RuntimeError: scatter(): Expected dtype int64 for index
- Python errors: valueerror: if using all scalar values, you must pass an index (four solutions)
- How to Solve attributeerror: ‘list’ object has no attribute ‘shape‘
- Python Valueerror: cannot index with vector containing Na / Nan values
- Django PythonConsole error: Requested setting DEFAULT_INDEX_TABLESPACE
- [resolution] str.contains() problem] valueerror: cannot index with vector containing Na/Nan values
- Python reads excel and stores it in the list according to the header hash copy.deepcopy
- [Solved] Selenium python send_key error: list object has no attribute
- When sending an email, an error was reported: AttributeError:’list’ object has no attribute’encode’