tensorflow/models · error · ValueError

dataset {} is not in {{{}}}

Error message

dataset {} is not in {{{}}}

What it means

Error "dataset {} is not in {{{}}}" thrown in tensorflow/models.

Source

Thrown at official/recommendation/movielens.py:99

NUM_RATINGS = {
    ML_1M: 1000209,
    ML_20M: 20000263
}

DATASET_TO_NUM_USERS_AND_ITEMS = {ML_1M: (6040, 3706), ML_20M: (138493, 26744)}


def _download_and_clean(dataset, data_dir):
  """Download MovieLens dataset in a standard format.

  This function downloads the specified MovieLens format and coerces it into a
  standard format. The only difference between the ml-1m and ml-20m datasets
  after this point (other than size, of course) is that the 1m dataset uses
  whole number ratings while the 20m dataset allows half integer ratings.
  """
  if dataset not in DATASETS:
    raise ValueError("dataset {} is not in {{{}}}".format(
        dataset, ",".join(DATASETS)))

  data_subdir = os.path.join(data_dir, dataset)

  expected_files = ["{}.zip".format(dataset), RATINGS_FILE, MOVIES_FILE]

  tf.io.gfile.makedirs(data_subdir)
  if set(expected_files).intersection(
      tf.io.gfile.listdir(data_subdir)) == set(expected_files):
    logging.info("Dataset {} has already been downloaded".format(dataset))
    return

  url = "{}{}.zip".format(_DATA_URL, dataset)

  temp_dir = tempfile.mkdtemp()
  try:
    zip_path = os.path.join(temp_dir, "{}.zip".format(dataset))
    zip_path, _ = urllib.request.urlretrieve(url, zip_path)

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/recommendation/movielens.py:99 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24). Data as JSON: /api/errors/85bbc752de1d8e86. Report an issue: GitHub.