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

[CLI]: "property 'model' of 'WandbCallback' object has no setter" #7578

Open
stellarpower opened this issue May 6, 2024 · 2 comments
Open
Assignees
Labels
c:integration Component: Integration

Comments

@stellarpower
Copy link

stellarpower commented May 6, 2024

Describe the bug

I believe something has changed in Keras 3 (at least in the master branch) relating to how callbacks are handled - the Callbacks class now has a model member built in; this is a python attribute, and so means that trying to assign to it in the constructor of a callback raises an exception that the model is read-only and so has no assignment function.

I actually hit this in my own callbvack earlier today, and I don't know if this is potentially a bug in Keras or it's something that will be here to stay in stable releases, but I see it in
keras-nightly 3.3.3.dev2024050603, and assuming the latter, lines like this one will be a problem - by the time the parent constructor has run, self.model is already a member of the class, and is actually wrapping the hidden member, hence the issue with trying to assign to it.

The quick and dirty workaround I took in my own code was simply to give the variable a different name (e.g. Model - _model is already in use, I believe).

Cheers

Additional Files

No response

Environment

WandB version: This affects master

OS:

Python version:

Versions of relevant libraries: Keras 3.3.3 nightly with TF (although it ought to be backend-agnostic)

Additional Context

No response

@umakrishnaswamy
Copy link
Contributor

hey @stellarpower - I was able to reproduce this with the general Callback class as well. is this occurring when you try accessing WandbMetricsLogger ? I'll be sure to flag this behavior with our integrations team

Also, please note that WandbCallback is a legacy callback so we recommend using the three new callback we added in 0.13.4 (docs here 20)

@stellarpower
Copy link
Author

Hi, thakns.

I don't think so, as I don't think I hit this problem with the other callback; I use the legacy callback because I think there isn't a new one for logging gradients, and that's one of the main reasons for using W&B, as this isn't available in Tensorboard anymore. So I generally run my models with both.

I'll let you know if I see evidence ot hte contrary though.

@kptkin kptkin added the c:integration Component: Integration label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:integration Component: Integration
Projects
None yet
Development

No branches or pull requests

5 participants