Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ABCMeta object is not subscriptable #595

Open
Doris404 opened this issue Sep 5, 2024 · 1 comment
Open

ABCMeta object is not subscriptable #595

Doris404 opened this issue Sep 5, 2024 · 1 comment

Comments

@Doris404
Copy link

Doris404 commented Sep 5, 2024

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
@Doris404
Copy link
Author

Doris404 commented Sep 5, 2024

I debug and find that privacy/fast_gradient_clipping/type_aliases.py line 24 trigger the bug. When we try to Iterable[Tensor] and Mapping[str, Tensor], it send error *** TypeError: 'ABCMeta' object is not subscriptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant