Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error is thrown when using AimCallback for HuggingFaceΒ #2546

@alberttorosyan

Description

@alberttorosyan

πŸ› Bug

When enabling AimCallback for HF training, the following error is thrown:

  File "/<PYTHON_ENV_PATH>/lib/python3.8/site-packages/aim/sdk/adapters/hugging_face.py", line 68, in setup
    self._run.set('model', {**vars(model.config), 'num_labels': model.num_labels})
  File "/<PYTHON_ENV_PATH>/lib/python3.8/site-packages/aim/sdk/run.py", line 368, in set
    self.meta_run_attrs_tree.set(key, val, strict)
  File "/<PYTHON_ENV_PATH>/lib/python3.8/site-packages/aim/storage/containertreeview.py", line 101, in aim.storage.containertreeview.ContainerTreeView.set
  File "/<PYTHON_ENV_PATH>/lib/python3.8/site-packages/aim/storage/treeutils.pyx", line 179, in encode_paths_vals
  File "/<PYTHON_ENV_PATH>/lib/python3.8/site-packages/aim/storage/treeutils.pyx", line 50, in unfold_tree
  File "/<PYTHON_ENV_PATH>/lib/python3.8/site-packages/aim/storage/treeutils.pyx", line 60, in unfold_tree
  File "/<PYTHON_ENV_PATH>/lib/python3.8/site-packages/aim/storage/treeutils_non_native.py", line 32, in convert_to_native_object
    raise TypeError(f'Unhandled non-native value {obj} of type {type(obj)}.')`
TypeError: Unhandled non-native value torch.float32 of type <class 'torch.dtype'>.

Expected behavior

Using AimCallback should not cause issues. Non-native objects should be converted to string before saving.

Environment

  • Aim Version (e.g., 3.16.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area / integrationsIssue area: integrations with other tools and libshelp wantedExtra attention is neededphase / shippedIssue phase: shippedtype / bugIssue type: something isn't working

    Type

    No type

    Projects

    Status

    Patch-issues

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions