diff --git a/deckard/base/model/art_pipeline.py b/deckard/base/model/art_pipeline.py index aece4fb5..d73fb0de 100644 --- a/deckard/base/model/art_pipeline.py +++ b/deckard/base/model/art_pipeline.py @@ -5,7 +5,7 @@ from art.estimators import BaseEstimator from hydra.utils import instantiate from omegaconf import DictConfig, OmegaConf - +import numpy as np from .keras_models import KerasInitializer, keras_dict # noqa F401 from .tensorflow_models import ( # noqa F401 TensorflowV1Initializer, @@ -71,6 +71,8 @@ def __call__(self): logger.info("Model moved to GPU") device = torch.device("cuda") model.to(device) + if isinstance(data[0][0], np.ndarray): + data = [torch.from_numpy(d).to(device) for d in data] data = [d.to(device) for d in data] model = TorchInitializer( data=data,