Skip to content

Commit 929b1c3

Browse files
committed
Fix dependencies
Signed-off-by: Beat Buesser <[email protected]>
1 parent 6d38d48 commit 929b1c3

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

tests/attacks/evasion/test_overload_attack.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ def test_generate(art_warning):
4646
torch.serialization.add_safe_globals([ultralytics.nn.tasks.C3])
4747
torch.serialization.add_safe_globals([ultralytics.nn.tasks.Bottleneck])
4848
torch.serialization.add_safe_globals([ultralytics.nn.tasks.Detect])
49-
torch.serialization.add_safe_globals([ultralytics.nn.modules.Conv])
50-
torch.serialization.add_safe_globals([ultralytics.nn.modules.Concat])
51-
torch.serialization.add_safe_globals([ultralytics.nn.modules.DFL])
49+
# from ultralytics.nn.modules import Conv
50+
# torch.serialization.add_safe_globals([ultralytics.nn.modules.Conv])
51+
# torch.serialization.add_safe_globals([ultralytics.nn.modules.Concat])
52+
# torch.serialization.add_safe_globals([ultralytics.nn.modules.DFL])
5253

5354
model = YOLO("yolov5su.pt")
5455
py_model = PyTorchYolo(model=model, input_shape=(3, 640, 640), channels_first=True)
@@ -98,9 +99,9 @@ def test_check_params(art_warning):
9899
torch.serialization.add_safe_globals([ultralytics.nn.tasks.C3])
99100
torch.serialization.add_safe_globals([ultralytics.nn.tasks.Bottleneck])
100101
torch.serialization.add_safe_globals([ultralytics.nn.tasks.Detect])
101-
torch.serialization.add_safe_globals([ultralytics.nn.modules.Conv])
102-
torch.serialization.add_safe_globals([ultralytics.nn.modules.Concat])
103-
torch.serialization.add_safe_globals([ultralytics.nn.modules.DFL])
102+
# torch.serialization.add_safe_globals([ultralytics.nn.modules.Conv])
103+
# torch.serialization.add_safe_globals([ultralytics.nn.modules.Concat])
104+
# torch.serialization.add_safe_globals([ultralytics.nn.modules.DFL])
104105

105106
model = YOLO("yolov5su.pt")
106107
py_model = PyTorchYolo(model=model, input_shape=(3, 640, 640), channels_first=True)

tests/attacks/evasion/test_steal_now_attack_later.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_generate(art_warning):
4949
torch.serialization.add_safe_globals([ultralytics.nn.tasks.C3])
5050
torch.serialization.add_safe_globals([ultralytics.nn.tasks.Bottleneck])
5151
torch.serialization.add_safe_globals([ultralytics.nn.tasks.Detect])
52-
torch.serialization.add_safe_globals([ultralytics.nn.modules.Conv])
52+
# torch.serialization.add_safe_globals([ultralytics.nn.modules.Conv])
5353
torch.serialization.add_safe_globals([ultralytics.nn.modules.Concat])
5454
torch.serialization.add_safe_globals([ultralytics.nn.modules.DFL])
5555

@@ -229,7 +229,7 @@ def test_check_params(art_warning):
229229
torch.serialization.add_safe_globals([ultralytics.nn.tasks.C3])
230230
torch.serialization.add_safe_globals([ultralytics.nn.tasks.Bottleneck])
231231
torch.serialization.add_safe_globals([ultralytics.nn.tasks.Detect])
232-
torch.serialization.add_safe_globals([ultralytics.nn.modules.Conv])
232+
# torch.serialization.add_safe_globals([ultralytics.nn.modules.Conv])
233233
torch.serialization.add_safe_globals([ultralytics.nn.modules.Concat])
234234
torch.serialization.add_safe_globals([ultralytics.nn.modules.DFL])
235235

0 commit comments

Comments
 (0)