Skip to content
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

Membership inference attack with MNIST and CIFAR10 may have some error #4

Open
AladaThor opened this issue Mar 10, 2022 · 4 comments
Open

Comments

@AladaThor
Copy link

The membership inference attack may have some errors with image data set.

@MinChen00
Copy link
Owner

Hi, would you please show the error?

@AladaThor
Copy link
Author

Cifar10 Error
The command I entered is "python main.py --exp mem_inf --unlearning_method scratch --original_model densenet --dataset_name cifar10" .
The error message I got :
INFO:2022-03-11 12:47:22,146: - exp_mem_inf_scratch - : obtaining shadow posterior
Traceback (most recent call last):
File "/unlearn_source/main.py", line 43, in
main(args)
File "/unlearn_source/main.py", line 33, in main
ExpMemInfScratch(args)
File "/unlearn_source/exp.py", line 423, in init
self.obtain_shadow_posterior()
File "/unlearn_source/exp.py", line 252, in obtain_shadow_posterior
self.shadow_posterior_df = self._obtain_posterior(self.args['shadow_set_num'], self.args['shadow_num_shard'], "shadow", path)
File "/unlearn_source/exp.py", line 459, in _obtain_posterior
test_pos_case = self._generate_test_case(unlearning_indices)
File "/unlearn_source/exp.py", line 368, in _generate_test_case
case = self.df[index]
File "/miniconda3/envs/unlearningleaks/lib/python3.9/site-packages/torchvision/datasets/cifar.py", line 114, in getitem
img, target = self.data[index], self.targets[index]
TypeError: only integer scalar arrays can be converted to a scalar index

@AladaThor
Copy link
Author

MNIST Error
The command I entered is "python main.py --exp mem_inf --unlearning_method scratch --original_model scnn --dataset_name mnist" .
The error message I got :
INFO:2022-03-11 12:54:44,767: - exp - : loaded data
Traceback (most recent call last):
File "/unlearn_source/main.py", line 43, in
main(args)
File "/unlearn_source/main.py", line 33, in main
ExpMemInfScratch(args)
File "/unlearn_source/exp.py", line 420, in init
self.determine_original_model()
File "/unlearn_source/exp.py", line 66, in determine_original_model
return DNN(net_name='simple_cnn', num_classes=self.num_classes, args=self.args)
File "/unlearn_source/models.py", line 30, in init
self.model = self.determine_net(net_name)
File "/unlearn_source/models.py", line 41, in determine_net
in_dim = self.in_dim[self.args['dataset_name']]
KeyError: 'mnist'

@AladaThor
Copy link
Author

Hi, sorry to bother you.
It been a while that this issue didn't be discuss or fix.
I wonder what is the problem.
Please reply if there is anything I didn't notice.

Thank you.

@MinChen00 MinChen00 reopened this Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants