Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TF version does not work #58

Open
Akergez opened this issue Mar 11, 2024 · 2 comments
Open

TF version does not work #58

Akergez opened this issue Mar 11, 2024 · 2 comments

Comments

@Akergez
Copy link

Akergez commented Mar 11, 2024

2024-03-11 11:23:06 Extracting staffline and symbols
Traceback (most recent call last):
  File "/var/home/akergez/.local/bin/oemer", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/var/home/akergez/.local/lib/python3.12/site-packages/oemer/ete.py", line 287, in main
    mxl_path = extract(args)
               ^^^^^^^^^^^^^
  File "/var/home/akergez/.local/lib/python3.12/site-packages/oemer/ete.py", line 131, in extract
    staff, symbols, stems_rests, notehead, clefs_keys = generate_pred(str(img_path), use_tf=args.use_tf)
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/home/akergez/.local/lib/python3.12/site-packages/oemer/ete.py", line 51, in generate_pred
    staff_symbols_map, _ = inference(
                           ^^^^^^^^^^
  File "/var/home/akergez/.local/lib/python3.12/site-packages/oemer/inference.py", line 42, in inference
    model = tf.keras.models.model_from_json(open(arch_path, "r").read())
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/home/akergez/.local/lib/python3.12/site-packages/keras/src/models/model.py", line 550, in model_from_json
    return serialization_lib.deserialize_keras_object(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/home/akergez/.local/lib/python3.12/site-packages/keras/src/saving/serialization_lib.py", line 687, in deserialize_keras_object
    cls = _retrieve_class_or_fn(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/var/home/akergez/.local/lib/python3.12/site-packages/keras/src/saving/serialization_lib.py", line 805, in _retrieve_class_or_fn
    raise TypeError(
TypeError: Could not locate class 'Functional'. Make sure custom classes are decorated with `@keras.saving.register_keras_serializable()`. Full object config: ...
@Akergez
Copy link
Author

Akergez commented Mar 11, 2024

I solved it, just installed tensorflow==2.15 instead of 2.16. Please specify version in setup.py, or update serialized objects

@chrisspen
Copy link

That didn't fix it for me. Got it to run for a little while, but it still crashed with the error:

Traceback (most recent call last):
  File "/home/chris/git/oemer/.env/bin/oemer", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/chris/git/oemer/.env/lib/python3.11/site-packages/oemer/ete.py", line 280, in main
    mxl_path = extract(args)
               ^^^^^^^^^^^^^
  File "/home/chris/git/oemer/.env/lib/python3.11/site-packages/oemer/ete.py", line 150, in extract
    coords_x, coords_y = estimate_coords(staff)
                         ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chris/git/oemer/.env/lib/python3.11/site-packages/oemer/dewarp.py", line 286, in estimate_coords
    new_gg_map = connect_nearby_grid_group(gg_map, grid_groups, grid_map, grids)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chris/git/oemer/.env/lib/python3.11/site-packages/oemer/dewarp.py", line 128, in connect_nearby_grid_group
    ref_gids = grid_groups[0].gids[:ref_count]
               ~~~~~~~~~~~^^^
IndexError: list index out of range

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants