meena-chatbot icon indicating copy to clipboard operation
meena-chatbot copied to clipboard

How make working under TF2?

Open Luke1962 opened this issue 1 year ago • 0 comments

First of all, thank you for your effort. I'd like to implement your code on my personal robot, beginning with some tests on PC Unfortunately without success, maybe because I've installed TF2 (2.10.0) on python 3.8.10 and the code seems written for TF1 . Is it true? I spent several days trying to convert code to TF2 using 'tf.compat.v1.xxxx' , but without success ( I'm an absolute newbie in Deep Learning). After loading the model 'model.ckpt-200000' from Italian_108M, in predict.py with :

    with tf.compat.v1.Session() as sess:
        new_saver = tf.compat.v1.train.import_meta_graph(MODEL_DIR + CHECKPOINT_NAME +'.meta')
        new_saver.restore(sess, MODEL_DIR+   CHECKPOINT_NAME) #'model.ckpt-200000'

I get exception 'Attempting to capture an EagerTensor without building a function' on nest statement: output_candidates = [chatbot_model.infer(encoded_inputs, decode_length=1) for _ in range(NUM_SAMPLES)]

At this point I don't know anymore how to go on... So my question is if is it possible to have some help on porting the code to TF2. Thank you in advance

Luke1962 avatar Oct 30 '22 10:10 Luke1962