recommenders-team/recommenders

[ASK] Multinomial VAE not working

Open

#1,915 opened on Apr 7, 2023

View on GitHub
 (4 comments) (0 reactions) (0 assignees)Python (2,972 forks)batch import
help wanted

Repository metrics

Stars
 (17,706 stars)
PR merge metrics
 (Avg merge 6d 16h) (10 merged PRs in 30d)

Description

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

Contributor guide