tensorflow / tensorflow/recommenders

ValueError: Unrecognized keyword argument(s): {'mask_value': None}

Open
#758 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

Hi.
When runnin notebook in colab on the line

dcn_result = run_models(use_cross_layer=True,
                        deep_layer_sizes=[192, 192])

the ValueError got raised

ValueError                                Traceback (most recent call last)
[/tmp/ipython-input-21-1445969553.py](https://localhost:8080/#) in <cell line: 0>()
----> 1 dcn_result = run_models(use_cross_layer=True,
      2                         deep_layer_sizes=[192, 192])

3 frames
[/tmp/ipython-input-19-2513347440.py](https://localhost:8080/#) in run_models(use_cross_layer, deep_layer_sizes, projection_dim, num_runs)
      4 
      5   for i in range(num_runs):
----> 6     model = DCN(use_cross_layer=use_cross_layer,
      7                 deep_layer_sizes=deep_layer_sizes,
      8                 projection_dim=projection_dim)

[/tmp/ipython-input-17-2634010612.py](https://localhost:8080/#) in __init__(self, use_cross_layer, deep_layer_sizes, projection_dim)
     27       vocabulary = vocabularies[feature_name]
     28       self._embeddings[feature_name] = tf.keras.Sequential(
---> 29           [tf.keras.layers.IntegerLookup(
     30               vocabulary=vocabulary, mask_value=None),
     31            tf.keras.layers.Embedding(len(vocabulary) + 1,

[/usr/local/lib/python3.11/dist-packages/keras/src/layers/preprocessing/integer_lookup.py](https://localhost:8080/#) in __init__(self, max_tokens, num_oov_indices, mask_token, oov_token, vocabulary, vocabulary_dtype, idf_weights, invert, output_mode, sparse, pad_to_max_tokens, name, **kwargs)
    337                 f"vocabulary_dtype={vocabulary_dtype}"
    338             )
--> 339         super().__init__(
    340             max_tokens=max_tokens,
    341             num_oov_indices=num_oov_indices,

[/usr/local/lib/python3.11/dist-packages/keras/src/layers/preprocessing/index_lookup.py](https://localhost:8080/#) in __init__(self, max_tokens, num_oov_indices, mask_token, oov_token, vocabulary_dtype, vocabulary, idf_weights, invert, output_mode, sparse, pad_to_max_tokens, name, **kwargs)
    191         kwargs.pop("dtype", None)
    192         if kwargs:
--> 193             raise ValueError(f"Unrecognized keyword argument(s): {kwargs}")
    194 
    195         if invert:

ValueError: Unrecognized keyword argument(s): {'mask_value': None}
Image

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

Open docs/examples/dcn.ipynb and inspect the IntegerLookup call in the DCN model initialization used by run_models. Compare its arguments with the Keras API shown in the traceback, then rerun the notebook cell; done means the example no longer raises the unrecognized-keyword ValueError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.