tensorflow / tensorflow/recommenders

Fstring and usage on TPU

Open
#346 1 comment 0 reactions 1 assignee View on GitHub

@maciejkula is already working on this.

Since Aug 6, 2021.

question
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.