Output Layers = Layer Namesi0 1 For I

[Solved] Output Layers = Layer Namesi0 1 For I | Scala - Code Explorer | yomemimo.com
Question : output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()] IndexError: invalid index to scalar variable.

Answered by : george-tirelo-shikwambana

# 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 : https://stackoverflow.com/questions/69756781/hi-i-have-error-related-to-object-detection-project | Last Update : Tue, 12 Jul 22

Answers related to output layers = layer namesi0 1 for i in net getunconnectedoutlayers indexerror invalid index to scalar variable

Code Explorer Popular Question For Scala