Solved by ptrblck in post #2 
              
              
                Your get_index_by_name method could implement something like this small hack: 
list(dict(features.named_children()).keys()).index('conv_2')
> 1