Skip to content

Training dataset creation failed #3192

@mikeumo

Description

@mikeumo

Is there an existing issue for this?

  • I have searched the existing issues

Operating System

Tahoe 26.2 (25C56)

DeepLabCut version

3.0.0rc13

What engine are you using?

pytorch

DeepLabCut mode

multi animal

Device type

M2 Max

Bug description 🐛

When i try to create a dataset (after labeling 50 frames), with the following training settings:

Image

I cannot create a training dataset.

If I use resnet_50 as a model (settings below), I do NOT get this problem.

Image

See logs for error messages

Steps To Reproduce

Under Create Training dataset:

choose Transfer Learning superanimal -- topviewmouse for weight initialization. The rest of the fields get set automatically.
The labeling part does not seem to matter as long as it's valid

click "Create Training Dataset"

Dataset creation silently fails (no pop-up message, only in terminal output)

Relevant log output

Loading DLC 3.0.0rc13...
INFO:console:Training dataset creation failed.
superanimal_topviewmouse_hrnet_w32.pt: 100%|███████████████████████████████████████████████████| 118M/118M [00:02<00:00, 52.8MB/s]
Traceback (most recent call last):
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/tarfile.py", line 1907, in gzopen
    t = cls.taropen(name, mode, fileobj, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/tarfile.py", line 1884, in taropen
    return cls(name, mode, fileobj, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/tarfile.py", line 1744, in __init__
    self.firstmember = self.next()
                       ^^^^^^^^^^^
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/tarfile.py", line 2662, in next
    raise e
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/tarfile.py", line 2635, in next
    tarinfo = self.tarinfo.fromtarfile(self)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/tarfile.py", line 1296, in fromtarfile
    buf = tarfile.fileobj.read(BLOCKSIZE)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/gzip.py", line 301, in read
    return self._buffer.read(size)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/_compression.py", line 68, in readinto
    data = self.read(len(byte_view))
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/gzip.py", line 499, in read
    if not self._read_gzip_header():
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/gzip.py", line 468, in _read_gzip_header
    last_mtime = _read_gzip_header(self._fp)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/gzip.py", line 428, in _read_gzip_header
    raise BadGzipFile('Not a gzipped file (%r)' % magic)
gzip.BadGzipFile: Not a gzipped file (b'PK')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/site-packages/dlclibrary/dlcmodelzoo/modelzoo_download.py", line 120, in _handle_downloaded_file
    with tarfile.open(file_path, mode="r:gz") as tar:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/tarfile.py", line 1854, in open
    return func(name, filemode, fileobj, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/tarfile.py", line 1911, in gzopen
    raise ReadError("not a gzip file") from e
tarfile.ReadError: not a gzip file

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/site-packages/deeplabcut/gui/tabs/create_training_dataset.py", line 278, in create_training_dataset
    self.weight_init_selector.get_super_animal_weight_init(
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/site-packages/deeplabcut/gui/tabs/create_training_dataset.py", line 710, in get_super_animal_weight_init
    weight_init = build_weight_init(
                  ^^^^^^^^^^^^^^^^^^
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/site-packages/deeplabcut/modelzoo/weight_initialization.py", line 91, in build_weight_init
    snapshot_path = get_super_animal_snapshot_path(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/site-packages/deeplabcut/pose_estimation_pytorch/modelzoo/utils.py", line 83, in get_super_animal_snapshot_path
    download_super_animal_snapshot(dataset, model_name)
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/site-packages/deeplabcut/pose_estimation_pytorch/modelzoo/utils.py", line 146, in download_super_animal_snapshot
    download_huggingface_model(
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/site-packages/dlclibrary/dlcmodelzoo/modelzoo_download.py", line 183, in download_huggingface_model
    _handle_downloaded_file(file_name, target_dir, rename_mapping)
  File "/Users/mike/.conda/envs/dlc3/lib/python3.11/site-packages/dlclibrary/dlcmodelzoo/modelzoo_download.py", line 127, in _handle_downloaded_file
    file_name = rename_mapping.get(file_name, file_name)
                ^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'get'
INFO:console:Loading....
INFO:console: 
INFO:console:superanimal_topviewmouse_hrnet_w32

Anything else?

No response

Code of Conduct

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghowtousedlcissue regarding the use of DeepLabCut

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions