tensorflow / tensorflow/recommenders

DCN notebook example deosn't run the full movielens section

Open
#755 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2k
Forks
300
PR merge metrics
No merged PRs in 30d

Description

This notebook doesn't fully run when running it in Google Colab (and it should run there with no issues).

Toy example works but Movielens example generates below error:

""""
/usr/local/lib/python3.11/dist-packages/keras/src/layers/layer.py:393: UserWarning: build() was called on layer 'dcn_1', however the layer does not have a build() method implemented and it looks like it has unbuilt state. This will cause the layer to be marked as built, despite not being actually built, which may cause failures down the line. Make sure to implement a proper build() method.
warnings.warn(


ValueError Traceback (most recent call last)

in <cell line: 0>()
----> 1 dcn_result = run_models(use_cross_layer=True,
2 deep_layer_sizes=[192, 192])

2 frames

/usr/local/lib/python3.11/dist-packages/keras/src/backend/tensorflow/trainer.py in multi_step_on_iterator(iterator)
130 if self.steps_per_execution == 1:
131 return tf.experimental.Optional.from_value(
--> 132 one_step_on_data(iterator.get_next())
133 )
134

ValueError: TensorFlowTrainer._make_function..one_step_on_data(data) should not modify its Python input arguments. Modifying a copy is allowed. The following parameter(s) were modified: data
""""

I tried to resolve it and it didn't work, I asked Gemini and that didn't help me to solve the issue either.

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.

Research direction

Run the DCN notebook's Movielens section in Google Colab, starting with the run_models(use_cross_layer=True, deep_layer_sizes=[192, 192]) call. Investigate the reported TensorFlowTrainer input-modification error and confirm that the full Movielens example completes without the failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
documentation, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.