Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()] IndexError: invalid index to scalar variable.

# This error occured after an upgrade of cv from version 3 to version 4.
#remedy change layer_names[i[0] - 1] to layer_names[i-1] as below: 

outputlayers = [layer_names[i-1] for i in net.getUnconnectedOutLayers()]
Comment

PREVIOUS NEXT
Code Example
Python :: pydub play audio 
Python :: how to append list in python 
Python :: pip --version 
Python :: discord.py get id of sent message 
Python :: check for string in list python 
Python :: how to print last element in a list python 
Python :: run multiple test cases pytest 
Python :: how to make a dice program in python 
Python :: Shapes (None, 1) and (None, 5) are incompatible 
Python :: How can write event for textbox in tkinter 
Python :: reading the JSON from a JSON file 
Python :: pandas astype str still object 
Python :: random seed generator minecraft 
Python :: divide every element in numpy array 
Python :: python add item to list 
Python :: find keys to minimum value in dict 
Python :: reversed() python 
Python :: how to find avrage python 
Python :: convert .py to exe 
Python :: how take in put as list in integer value 
Python :: python check variable size in memory 
Python :: python suppress warnings in function 
Python :: how to use def in python 
Python :: map two csv files python 
Python :: display pandas dataframe with border 
Python :: xlabel font type matplotlib 
Python :: flat numpy array 
Python :: jupyterlab interactive plot 
Python :: pandas if python 
Python :: opening files in python 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =