tensorflow / tensorflow/privacy

ModuleNotFoundError: No module named 'tensorflow_privacy.privacy.membership_inference_attack'

Open
#151 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2k
Forks
477
Avg merge
22h 12m
Merged PRs (30d)
1

Description

Following the README on the membership inference page yields an error.

I am running TensorFlow Privacy in a Google Colab notebook.

After adding the module with pip through !pip install tensorflow-privacy, I try running the lines specified in the README:

from tensorflow_privacy.privacy.membership_inference_attack import membership_inference_attack as mia

This yields the following error message:

---------------------------------------------------------------------------

ModuleNotFoundError                       Traceback (most recent call last)

<ipython-input-10-43809957f96c> in <module>()
      1 # tensorflow privacy mia imports
----> 2 from tensorflow_privacy.privacy.membership_inference_attack import membership_inference_attack as mia
      3 from tensorflow_privacy.privacy.membership_inference_attack.data_structures import AttackInputData
      4 from tensorflow_privacy.privacy.membership_inference_attack.data_structures import SlicingSpec
      5 from tensorflow_privacy.privacy.membership_inference_attack.data_structures import AttackType

ModuleNotFoundError: No module named 'tensorflow_privacy.privacy.membership_inference_attack'


---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

TensorFlow Privacy seems to be successfully installed before:

Requirement already satisfied: tensorflow-privacy in /usr/local/lib/python3.6/dist-packages (0.2.2)

I would be happy to know how I can keep on using the module. Thank you in advance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the membership inference README linked in the issue and reproduce the import in a Google Colab environment after installing tensorflow-privacy 0.2.2. Inspect the installed package to compare its contents with the documented module path. Done means the documented example works with the stated installation, or the README clearly identifies the required package version or setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.