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

Cannot load DataLabeler due to error in labeler utils. #1126

Open
JGSweets opened this issue Mar 25, 2024 · 8 comments
Open

Cannot load DataLabeler due to error in labeler utils. #1126

JGSweets opened this issue Mar 25, 2024 · 8 comments
Assignees
Labels
Bug Something isn't working

Comments

@JGSweets
Copy link
Collaborator

General Information:

  • OS: linux/x86_64
  • Python version: 3.10.14
  • Library version: DataProfiler==0.10.8

Describe the bug:
On line:

return self.add_weight(

I receive the error:
TypeError: Metric.add_weight() got multiple values for argument 'shape'

Possibly related to: https://stackoverflow.com/questions/62976818/add-weight-got-multiple-values-for-argument-name-while-using-a-custom-attent

Current TF Version: tensorflow==2.16.1

To Reproduce:

import dataprofiler as dp


labeler = dp.DataLabeler.load_from_library("unstructured")

Expected behavior:
Loads the labeler

Additional context:
I think this has to do with something in TF updating, but the DP not updating with it.
Requiring tensorflow==2.15.1 is a current workaround.

@JGSweets JGSweets added the Bug Something isn't working label Mar 25, 2024
@JGSweets
Copy link
Collaborator Author

Not 100% positive, but this might be resolved just by setting name=name
looks like keras 3.0.0 changes the metric format for __init__
https://github.com/keras-team/keras/blob/v3.1.1/keras/metrics/metric.py#L9

Also, might need to upgrade the keras version.

@taylorfturner
Copy link
Contributor

Yep, we noticed this last week. Requiring tensorflow==2.15.1 is a current workaround.: yep, temporary fix is the current recommended workaround.

Thanks for documenting in an issue @JGSweets 👍

@JGSweets
Copy link
Collaborator Author

JGSweets commented Mar 25, 2024

Looks like that might resolve that issue.
The new issue being the models all need to be updated to use Version 3 of keras.

ValueError: File format not supported: filepath=.... Keras 3 only supports V3 .keras files and legacy H5 format files (.h5 extension). Note that the legacy SavedModel format is not supported by load_model() in Keras 3.

@JGSweets
Copy link
Collaborator Author

@taylorfturner
Copy link
Contributor

Yeah, I think you are right -- after I saw the errors on the PR checks, looks like the model would need a version update itself

@slonweiss
Copy link

slonweiss commented Apr 3, 2024

Just a note that the current workaround does not work on Windows, as Tensorflow version 2.15.1 is not available.

@JGSweets
Copy link
Collaborator Author

Any update on this? Thanks!

@taylorfturner
Copy link
Contributor

Any update on this? Thanks!

Not yet, @JGSweets. Thanks for the bump though -- haven't forgot about it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants