tensorflow / tensorflow/recommenders
Fstring and usage on TPU
@maciejkula is already working on this.
Since Aug 6, 2021.
- Dominant language
- Python
- Stars
- 2k
- Forks
- 300
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
So I have been trying to make use of the composite optimizer in the tf-recommenders package for an object detection project. There are issues that result from training the model on the TPU, the issues mostly stem from the usage of python f-string when raising a warning or an error. These prevent TPU compilation without:
tf.config.set_soft_device_placement(True)
An example of this usage from the Composite Optimizer apply gradients method is the following:
raise ValueError(
f"The set of variables handled by each optimizer should be "
f"disjoint, but variable {v} is handled both "
f"by {var_optimizer_dict[v.ref()]} and {optimizer}.")
This issue shows up in both tensorflow 2.4.0 and 2.5.0
NOTE: removing the f-string from the optimizer etc. allows for full usage on the TPU.
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.
Assessment
This issue has not been assessed yet.