Skip to content

Commit

Permalink
fix test_model.py (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz authored Jan 11, 2024
1 parent 00362a8 commit f60be1f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@

def torch2tf(torch_name):
fields = torch_name.split('.')
element_id = int(fields[2])
offset = int(fields[2] == "networks")
element_id = int(fields[2 + offset])
if fields[0] == 'descriptor':
layer_id = int(fields[4]) + 1
weight_type = fields[5]
layer_id = int(fields[4 + offset]) + 1
weight_type = fields[5 + offset]
return 'filter_type_all/%s_%d_%d:0' % (weight_type, layer_id, element_id)
elif fields[3] == 'deep_layers':
layer_id = int(fields[4])
Expand Down

0 comments on commit f60be1f

Please sign in to comment.