tensorflow / tensorflow/privacy
ABCMeta object is not subscriptable
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2k
- Forks
- 477
- Avg merge
- 22h 12m
- Merged PRs (30d)
- 1
Description
I am using tensorflow_privacy package for dp training. The error messages are as follows:
Traceback (most recent call last):
File "src/synthesize.py", line 9, in <module>
from p3gm import P3GM
File "/home/ruc/xiaotong/OpenDataGen/log/20240903/P3GM/src/p3gm.py", line 8, in <module>
from tensorflow_privacy.privacy.analysis.rdp_accountant import compute_rdp, get_privacy_spent
File "/home/ruc/xiaotong/OpenDataGen/log/20240903/P3GM/src/tensorflow_privacy/__init__.py", line 61, in <module>
from tensorflow_privacy.privacy.keras_models.dp_keras_model import DPModel
File "/home/ruc/xiaotong/OpenDataGen/log/20240903/P3GM/src/tensorflow_privacy/privacy/keras_models/dp_keras_model.py", line 20, in <module>
from tensorflow_privacy.privacy.fast_gradient_clipping import clip_grads
File "/home/ruc/xiaotong/OpenDataGen/log/20240903/P3GM/src/tensorflow_privacy/privacy/fast_gradient_clipping/clip_grads.py", line 29, in <module>
from tensorflow_privacy.privacy.fast_gradient_clipping import common_manip_utils
File "/home/ruc/xiaotong/OpenDataGen/log/20240903/P3GM/src/tensorflow_privacy/privacy/fast_gradient_clipping/common_manip_utils.py", line 19, in <module>
from tensorflow_privacy.privacy.fast_gradient_clipping import type_aliases
File "/home/ruc/xiaotong/OpenDataGen/log/20240903/P3GM/src/tensorflow_privacy/privacy/fast_gradient_clipping/type_aliases.py", line 24, in <module>
PackedTensors = Union[Tensor, Iterable[Tensor], Mapping[str, Tensor]]
TypeError: 'ABCMeta' object is not subscriptable
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read tensorflow_privacy/privacy/fast_gradient_clipping/type_aliases.py, especially the PackedTensors definition, and reproduce the failing import from the traceback. Done means the tensorflow_privacy import no longer raises the reported TypeError.
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
- Needs clarification
- Newbie friendliness
- 35/100