Struggling to upgrade code to tensorflow 2.0

Hi, I am replicating a project that is written in tf_1.0.
I used the tf_upgrade_v2 scripts to upgrade the code to be compatible with tensorflow v_2.0.

However, there is just one decoder function, that I cant upgrade. I have looked for help on StackOverflow, github, and got no help!

Function:

decoder_outputs,decoder_state = tf.contrib.legacy_seq2seq.attention_decoder(
            decoder_inputs = decoder_inputs,
            initial_state = encoder_state,
            attention_states = encoder_outputs,
            cell = cell,
            output_size = word_embedding_dim,
            loop_function = None if mode=='pretrain' else feed_prev_loop,
            scope = scope
        )

How do I get this thing to work in tf_2.0?

If you want to take a look at the whole project, it is here: https://github.com/yaushian/CycleGAN-sentiment-transfer/blob/master/lib/seq2seq.py

Hi @Sachin, As mentioned in this github comment

There is no direct replacement for this function but there are modules that achieve the same thing.

Thank You.

1 Like