google-parfait / tensorflow-federated

An open-source framework for machine learning and other computations on decentralized data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

donwany opened this issue · comments

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

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.