recommenders-team/recommenders

[ASK] Multinomial VAE not working

Open

#1,915 建立於 2023年4月7日

在 GitHub 查看
 (4 留言) (0 反應) (0 負責人)Python (2,972 fork)batch import
help wanted

倉庫指標

Star
 (17,706 star)
PR 合併指標
 (平均合併 6天 16小時) (30 天內合併 10 個 PR)

描述

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

貢獻者指南