Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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()]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #invalid #index #scalar
ADD COMMENT
Topic
Name
9+6 =