Dataset Viewer issue

#1
by bhawks - opened
Fast Machine Learning Lab org
edited 18 days ago

The dataset viewer is not working.

Error details:

Exception:    SplitsNotFoundError
Message:      The split names could not be parsed from the dataset config.
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.9/tarfile.py", line 191, in nti
                  n = int(s.strip() or "0", 8)
              ValueError: invalid literal for int() with base 8: '1d/archi'
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/usr/local/lib/python3.9/tarfile.py", line 2588, in next
                  tarinfo = self.tarinfo.fromtarfile(self)
                File "/usr/local/lib/python3.9/tarfile.py", line 1292, in fromtarfile
                  obj = cls.frombuf(buf, tarfile.encoding, tarfile.errors)
                File "/usr/local/lib/python3.9/tarfile.py", line 1234, in frombuf
                  chksum = nti(buf[148:156])
                File "/usr/local/lib/python3.9/tarfile.py", line 193, in nti
                  raise InvalidHeaderError("invalid header")
              tarfile.InvalidHeaderError: invalid header
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 299, in get_dataset_config_info
                  for split_generator in builder._split_generators(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/webdataset/webdataset.py", line 81, in _split_generators
                  first_examples = list(islice(pipeline, self.NUM_EXAMPLES_FOR_FEATURES_INFERENCE))
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/webdataset/webdataset.py", line 32, in _get_pipeline_from_tar
                  for filename, f in tar_iterator:
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/track.py", line 49, in __iter__
                  for x in self.generator(*self.args):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 1343, in _iter_from_urlpath
                  yield from cls._iter_tar(f)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 1294, in _iter_tar
                  stream = tarfile.open(fileobj=f, mode="r|*")
                File "/usr/local/lib/python3.9/tarfile.py", line 1822, in open
                  t = cls(name, filemode, stream, **kwargs)
                File "/usr/local/lib/python3.9/tarfile.py", line 1703, in __init__
                  self.firstmember = self.next()
                File "/usr/local/lib/python3.9/tarfile.py", line 2600, in next
                  raise ReadError(str(e))
              tarfile.ReadError: invalid header
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/split_names.py", line 65, in compute_split_names_from_streaming_response
                  for split in get_dataset_split_names(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 353, in get_dataset_split_names
                  info = get_dataset_config_info(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 304, in get_dataset_config_info
                  raise SplitsNotFoundError("The split names could not be parsed from the dataset config.") from err
              datasets.inspect.SplitsNotFoundError: The split names could not be parsed from the dataset config.

Hello! I'm attempting to get the dataset viewer working with my tar.gz files, but I run into the above error.

The structure of the dataset is nested tar.gz files, with each folder (i.e. conv1d) containing N tar.gz archives, each of those N archives (i.e conv1d/archive_1.tar.gz) containing M tar.gz archives, with each of those M archives containing a series of files and directories corresponding to some firmware projects for FPGAs.

I have also checked that each tar file in the conv1d directory is valid using the following script:

#!/bin/bash

# Directory containing tar.gz files
directory=${1:-.}
# Number of cores to use
num_cores=${2:-1}

# Function to check a single file
check_file() {
    file=$1
    if gunzip -c "$file" | tar -t > /dev/null 2>&1; then
        echo "Valid: $file"
    else
        echo "Invalid: $file"
    fi
}

export -f check_file

# Find all tar.gz files and process them in parallel
find "$directory" -name "*.tar.gz" -type f | parallel -j "$num_cores" check_file

Thank you for your help!

cc @albertvillanova @lhoestq @severo .

Sign up or log in to comment