Skip to content

Commit b61e63a

Browse files
authored
fix(research): replace deprecated np.int with int in mobilenet_v3 (#13609)
The use of `np.int` was deprecated in NumPy 1.20 and completely removed in NumPy 1.24. This change caused `_reduce_consecutive_layers` to fail with an AttributeError when using NumPy 1.24+. This commit replaces `np.int` with the built-in `int` function to ensure compatibility with modern NumPy versions. Affected file: research/slim/nets/mobilenet/mobilenet_v3.py
1 parent b654c5b commit b61e63a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

research/slim/nets/mobilenet/mobilenet_v3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ def _reduce_consecutive_layers(conv_defs, start_id, end_id, multiplier=0.5):
748748
defs = copy.deepcopy(conv_defs)
749749
for d in defs['spec'][start_id:end_id+1]:
750750
d.params.update({
751-
'num_outputs': np.int(np.round(d.params['num_outputs'] * multiplier))
751+
'num_outputs': int(np.round(d.params['num_outputs'] * multiplier))
752752
})
753753
return defs
754754

0 commit comments

Comments
 (0)