-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tutorial MNIST step 7 #5
Comments
Thank you for submitting an issue. The
# Generated by counterfit #
import pickle
import numpy as np
from counterfit.core.targets import ArtTarget
class Mnist(ArtTarget):
model_name = "mnist"
model_data_type = "image"
model_endpoint = "counterfit/targets/tutorial/mnist_sklearn_pipeline.pkl"
model_input_shape = (1, 28, 28)
model_output_classes = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
X = []
def __init__(self):
self.clip_values = (0, 255)
with open(self.model_endpoint, "rb") as f:
self.model = pickle.load(f)
self.data_file = "counterfit/targets/tutorial/mnist_784.npz"
self.sample_data = np.load(self.data_file, allow_pickle=True)
self.X = self.sample_data["X"]
def __call__(self, x):
scores = self.model.predict_proba(x.reshape(x.shape[0], -1))
return scores.tolist()
Le me know if that worked and I'll close this issue. In case anyone sees the above error - it usually means that |
@moohax you can close the issue. Thank you. |
When I type in predict command.
The error shown
mnist> predict
[!] No index sample, setting random index.
EXCEPTION of type 'ValueError' occurred with message: empty range for randrange() (0,0, 0)
[!] To enable full traceback, run the following command: 'setg debug true'
the sample of my code.
C:\Users\Eng Soon Cheah\Desktop\counterfit-main\counterfit\commands\new.py
The text was updated successfully, but these errors were encountered: