UnlearningLeaks icon indicating copy to clipboard operation
UnlearningLeaks copied to clipboard

Membership inference attack with MNIST and CIFAR10 may have some error

Open AladaThor opened this issue 2 years ago • 4 comments

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

AladaThor avatar Mar 10 '22 08:03 AladaThor

Hi, would you please show the error?

MinChen00 avatar Mar 10 '22 10:03 MinChen00

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 avatar Mar 11 '22 04:03 AladaThor

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 avatar Mar 11 '22 04:03 AladaThor

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.

AladaThor avatar Apr 24 '22 09:04 AladaThor