diff --git a/art/defences/detector/poison/roni.py b/art/defences/detector/poison/roni.py index 55877ad828..52372d0d53 100644 --- a/art/defences/detector/poison/roni.py +++ b/art/defences/detector/poison/roni.py @@ -25,7 +25,7 @@ import logging from copy import deepcopy -from typing import Any, Callable, List, Tuple, Union, TYPE_CHECKING +from typing import Callable, List, Tuple, Union, TYPE_CHECKING import numpy as np from sklearn.model_selection import train_test_split diff --git a/art/utils.py b/art/utils.py index 83d057d152..eaa55f7948 100644 --- a/art/utils.py +++ b/art/utils.py @@ -1305,11 +1305,11 @@ def load_stl() -> DATASET_TYPE: with open(os.path.join(path, "train_y.bin"), "rb") as f_numpy: y_train = np.fromfile(f_numpy, dtype=np.uint8) - y_train -= 1 + y_train = y_train - 1 with open(os.path.join(path, "test_y.bin"), "rb") as f_numpy: y_test = np.fromfile(f_numpy, dtype=np.uint8) - y_test -= 1 + y_test = y_test - 1 x_train, y_train = preprocess(x_train, y_train) x_test, y_test = preprocess(x_test, y_test) diff --git a/tests/attacks/evasion/test_auto_attack.py b/tests/attacks/evasion/test_auto_attack.py index bfc70b2d58..86fa6b3769 100644 --- a/tests/attacks/evasion/test_auto_attack.py +++ b/tests/attacks/evasion/test_auto_attack.py @@ -196,7 +196,9 @@ def test_classifier_type_check_fail(art_warning): @pytest.mark.skip_framework("tensorflow1", "tensorflow2v1", "keras", "non_dl_frameworks", "mxnet", "kerastf") def test_generate_parallel(art_warning, fix_get_mnist_subset, image_dl_estimator): try: + import tensorflow as tf classifier, _ = image_dl_estimator(from_logits=True) + classifier.model.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=0.01)) norm = np.inf eps = 0.3