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

[ASK] Multinomial VAE not working #1915

Open
kone807 opened this issue Apr 7, 2023 · 4 comments
Open

[ASK] Multinomial VAE not working #1915

kone807 opened this issue Apr 7, 2023 · 4 comments
Labels
help wanted Need help from developers

Comments

@kone807
Copy link
Contributor

kone807 commented Apr 7, 2023

Description

I am running Multinomial VAE on movielens 1m dataset as given in the example notebook but getting an error when fitting the model. The line of code is -

with Timer() as t: model_without_anneal.fit(x_train=train_data, x_valid=val_data, x_val_tr=val_data_tr, x_val_te=val_data_te_ratings, # with the original ratings mapper=am_val ) print("Took {} seconds for training.".format(t))

and the corresponding error is -

Error message - TypeError: You are passing KerasTensor(type_spec=TensorSpec(shape=(), dtype=tf.float32, name=None), name='Placeholder:0', description="created by layer 'tf.cast_8'"), an intermediate Keras symbolic input/output, to a TF API that does not allow registering custom dispatchers, such as tf.cond, tf.function, gradient tapes, or tf.map_fn. Keras Functional model construction only supports TF API calls that do support dispatching, such as tf.math.add or tf.reshape. Other APIs cannot be called directly on symbolic Kerasinputs/outputs. You can work around this limitation by putting the operation in a custom Keras layer call and calling that layer on this symbolic input/output.

Please guide what can be done about this. Thank you.

Other Comments

@kone807 kone807 added the help wanted Need help from developers label Apr 7, 2023
@Wei2624
Copy link

Wei2624 commented Apr 7, 2023

Run:
from tensorflow.python.framework.ops import disable_eager_execution disable_eager_execution()
before building the model works for me.

@kone807
Copy link
Contributor Author

kone807 commented Apr 8, 2023

Run: from tensorflow.python.framework.ops import disable_eager_execution disable_eager_execution() before building the model works for me.

This resolved the previous error, however, now I get error in Adam optimizer -> AttributeError: 'Adam' object has no attribute 'get_updates'

The resolution I found was to add .legacy while making the import but that won't be feasible given that Adam is being imported in the recommenders file which I am using as a blackbox. Please suggest any measures to handle this. Thank you.

@mariaKlv
Copy link

The aforementioned error is still persistent, while the aforementioned solution did not seem any helpful for my case. Are the any updates yet?

@miguelgfierro miguelgfierro reopened this Aug 30, 2023
@miguelgfierro
Copy link
Collaborator

Reopening issue

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

No branches or pull requests

4 participants