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

AttributeError: module 'tensorflow._api.v2.nest' has no attribute 'map_struture' #4184

Open
donwany opened this issue Oct 12, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@donwany
Copy link

donwany commented Oct 12, 2023

Describe the bug
A clear and concise description of what the bug is. It is often helpful to
provide a link to a colab notebook that
reproduces the bug.

Environment (please complete the following information):

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
  • Python package versions (e.g., TensorFlow Federated, TensorFlow):
  • Python version: 3.9.5
  • Bazel version (if building from source): 6.3.2
  • CUDA/cuDNN version:
  • What TensorFlow Federated execution stack are you using?

tensorboard==2.12.3
tensorboard-data-server==0.7.1
tensorflow==2.12.1
tensorflow-addons==0.21.0
tensorflow-compression==2.12.0
tensorflow-datasets==4.9.3
tensorflow-estimator==2.12.0
tensorflow-federated==0.61.0
tensorflow-io-gcs-filesystem==0.34.0
tensorflow-metadata==1.14.0
tensorflow-model-optimization==0.7.3
tensorflow-privacy==0.8.10
tensorflow-probability==0.20.1

Note: You can collect the Python package information by running pip3 freeze
from the command line and most of the other information can be collected using
TensorFlows environment capture
script.

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

File "/home/ts2434/.cache/bazel/_bazel_ts2434/611b2968f932895d45fa91c474b78521/execroot/main/bazel-out/k8-fastbuild/bin/optimization/main/federated_trainer.runfiles/main/optimization/shared/fed_avg_schedule_loss_selection.py", line 242, in client_update *
tf.nest.map_structure(model_weights, initial_weights)

AttributeError: module 'tensorflow._api.v2.nest' has no attribute 'map_structure'

File "/home/ts2434/.cache/bazel/_bazel_ts2434/611b2968f932895d45fa91c474b78521/execroot/main/bazel-out/k8-fastbuild/bin/optimization/main/federated_trainer.runfiles/main/optimization/shared/fed_avg_schedule_loss_selection.py", line 242, in client_update *
tf.nest.map_structure(model_weights, initial_weights)

TypeError: not all arguments converted during string formatting
@donwany donwany added the bug Something isn't working label Oct 12, 2023
@michaelreneer
Copy link
Collaborator

This looks likes is an error raised from a script that you wrote not from TFF? However, this is a strange error because to my knowledge map_structure has been around for a while, https://www.tensorflow.org/api_docs/python/tf/nest/map_structure.

@michaelreneer michaelreneer self-assigned this Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants