Skip to content

Error saving HumpbackNorthAtlantic #60

Description

@alpha-tango

f08472f in acodet/funcs.py around L446 reverted fixes I made in an earlier commit, a436d05. I am now getting this error (and can fix it by reimplementing the .item() calls).

 File "mydir/acodet/run.py", line 70, in main
    run_training(**kwargs)
  File "mydir/acodet/acodet/train.py", line 334, in run_training
    save_model_results(checkpoint_dir, result)
  File "mydir/acodet/acodet/funcs.py", line 446, in save_model_results
    json.dump(result, f)
  File "/homedir/.local/share/uv/python/cpython-3.11.14-linux-x86_64-gnu/lib/python3.11/json/__init__.py", line 179, in dump
    for chunk in iterable:
  File "/homedir/.local/share/uv/python/cpython-3.11.14-linux-x86_64-gnu/lib/python3.11/json/encoder.py", line 432, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/homedir/.local/share/uv/python/cpython-3.11.14-linux-x86_64-gnu/lib/python3.11/json/encoder.py", line 406, in _iterencode_dict
    yield from chunks
  File "/homedir/.local/share/uv/python/cpython-3.11.14-linux-x86_64-gnu/lib/python3.11/json/encoder.py", line 326, in _iterencode_list
    yield from chunks
  File "/homedir/.local/share/uv/python/cpython-3.11.14-linux-x86_64-gnu/lib/python3.11/json/encoder.py", line 439, in _iterencode
    o = _default(o)
        ^^^^^^^^^^^
  File "/homedir/.local/share/uv/python/cpython-3.11.14-linux-x86_64-gnu/lib/python3.11/json/encoder.py", line 180, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type ndarray is not JSON serializable

@vskode I assume you made the change because you were getting an error there? What was it?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions