Git Product home page Git Product logo

Comments (4)

amad-person avatar amad-person commented on June 12, 2024 1

Hi @chris-prenode I will try the experiment with your ResNet model and get back to you.

from ml_privacy_meter.

chris-prenode avatar chris-prenode commented on June 12, 2024

I forgot important information: My pre-trained ResNet model was created by TensorFlow version 2.4!

This could lead to the error.
I used the following code: https://github.com/sayakpaul/Sharpness-Aware-Minimization-TensorFlow/blob/main/resnet_cifar10.py
To create my ResNet20 model.

from ml_privacy_meter.

EchizenG avatar EchizenG commented on June 12, 2024

I have the same problem. But I was trying to load pytorch tried model which had been converted to keras model.

File "/home/yang/gan/118/ml_privacy_meter/attackdc.py", line 1, in
import numpy as np
File "/home/yang/gan/118/ml_privacy_meter/ml_privacy_meter/attack/meminf.py", line 168, in init
self.create_attack_components(layers)
File "/home/yang/gan/118/ml_privacy_meter/ml_privacy_meter/attack/meminf.py", line 278, in create_attack_components
self.create_gradient_components(model, layers)
File "/home/yang/gan/118/ml_privacy_meter/ml_privacy_meter/attack/meminf.py", line 254, in create_gradient_components
module = cnn_for_fcn_gradients(shape)
File "/home/yang/gan/118/ml_privacy_meter/ml_privacy_meter/attack/meminf_modules/create_cnn.py", line 12, in cnn_for_fcn_gradients
dim2 = int(input_shape[1])
File "/home/yang/tools/anaconda3/envs/datacond/lib/python3.7/site-packages/tensorflow/python/framework/tensor_shape.py", line 887, in getitem
return self._dims[key].value
IndexError: list index out of range

I tried to reduce the value of 'gradients_to_exploit' to 1 and it worked.
I just notice that in 'cnn_for_fcn_gradients' it treat the variables in model as 2 or 3 dimentions. Actually, in my model, it just only 1 dimention. Only the first layer has 4 dimentions so I change 'gradients_to_exploit' to 1.

from ml_privacy_meter.

amad-person avatar amad-person commented on June 12, 2024

Hi all, we have released a new version of our tool which works with the newer versions of TensorFlow and PyTorch. Hopefully this should resolve the gradient issue reported here.

from ml_privacy_meter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.