membership-inference icon indicating copy to clipboard operation
membership-inference copied to clipboard

Error while attacking in 'a' type

Open fight-think opened this issue 3 years ago • 0 comments

source_features: (5000, 10), target_features: (5000, 10) Traceback (most recent call last): File "pipeline.py", line 244, in attack(args) File "pipeline.py", line 116, in attack dists_source_in = attack_features_tf1.dists(source_model, source_train_ds, attack="HSJ", max_samples=max_samples, File "/home/jiaxin/code/membership_inference_attack/label-only_MIA/attack_features_tf1.py", line 24, in dists output = model_(x) File "/home/jiaxin/.local/lib/python3.8/site-packages/keras/engine/base_layer_v1.py", line 765, in call outputs = call_fn(cast_inputs, *args, **kwargs) File "/home/jiaxin/.local/lib/python3.8/site-packages/keras/engine/sequential.py", line 373, in call return super(Sequential, self).call(inputs, training=training, mask=mask) File "/home/jiaxin/.local/lib/python3.8/site-packages/keras/engine/functional.py", line 451, in call return self._run_internal_graph( File "/home/jiaxin/.local/lib/python3.8/site-packages/keras/engine/functional.py", line 589, in _run_internal_graph outputs = node.layer(*args, **kwargs) File "/home/jiaxin/.local/lib/python3.8/site-packages/keras/engine/base_layer_v1.py", line 765, in call outputs = call_fn(cast_inputs, *args, **kwargs) File "/home/jiaxin/.local/lib/python3.8/site-packages/keras/layers/convolutional.py", line 246, in call outputs = self.convolution_op(inputs, self.kernel) File "/home/jiaxin/.local/lib/python3.8/site-packages/keras/layers/convolutional.py", line 231, in convolution_op return tf.nn.convolution( File "/home/jiaxin/.local/lib/python3.8/site-packages/tensorflow/python/util/traceback_utils.py", line 153, in error_handler raise e.with_traceback(filtered_tb) from None File "/home/jiaxin/.local/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 6274, in _assert_same_graph raise ValueError( ValueError: Tensor("kernel_6/Read/ReadVariableOp:0", shape=(3, 3, 3, 32), dtype=float32) must be from the same graph as Tensor("Placeholder_20:0", shape=(None, 32, 32, 3), dtype=float32) (graphs are <tensorflow.python.framework.ops.Graph object at 0x7fabb00d4820> and <tensorflow.python.framework.ops.Graph object at 0x7faae8440cd0>).

fight-think avatar Nov 29 '21 00:11 fight-think