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

Replace legacy embedding_rnn_seq2seq #55

Open
adeshpande3 opened this issue Feb 17, 2020 · 3 comments
Open

Replace legacy embedding_rnn_seq2seq #55

adeshpande3 opened this issue Feb 17, 2020 · 3 comments

Comments

@adeshpande3
Copy link
Owner

In the Seq2Seq.py file we currently use tf.contrib.legacy_seq2seq.embedding_rnn_seq2seq. We'd like to move off of this layer because it's a legacy layer and because it doesn't work with Python3 (which we'd like to move the repo towards).

The current function's documentation is here. It is basically a TF layer that takes in inputs from the encoder and decoder to produce the final state of the decoder which is eventually used to provide the final word probabiliies/predictions.

The refactor should make sure that we're still using a sequence to sequence model but open to slight changes in the network architecture depending on what the new tensorflow functions need. Also, ideally we'd like to keep the data input format (described in the README) the same.

Some places to start

If you'd like to take it on, I would also make sure that the code works on the python3-upgrade branch and that the code is in python3

Feel free to post if you have any questions or need help with anything.

cc @TotallyNotChase

Additional context on this issue #53

@TotallyNotChase
Copy link
Collaborator

I'd also like to add, all the modifications and tests should either be performed on the python3-upgrade branch or some another branch that is directly derived from python3-upgrade not master.

Lastly, one might notice that the tensorflow library is imported as tensorflow.compat.v1, this is to follow the official migration guideline here. For now, we want to keep this import exactly like this so we can just emulate the tensorflow 1.0 functions. Instead of changing the functions to new tensorflow 2.0 ones, importing the library with this name ensures everything stays the same and works the same.

Except for contrib ofcourse, that's what this issue is about :)

@Morasiu
Copy link

Morasiu commented Feb 27, 2020

I got it to work (with a lot of warning) in Python 3 if I force to install Tensorflow 1.15.

pip install tensorflow==1.15

I know that it doesn't resolve using on legacy API, but hey it's working now on Python 3.

@TotallyNotChase
Copy link
Collaborator

@adeshpande3 Hello again, I rolled out a bunch of changes and ported the tensorflow 1.0 functions to tensorflow 2.0 over in the python3-upgrade branch. Right now, the functions do work, although I'm not sure if they are working as intended. I personally don't have a rig to be able to train the AI, could you please check if the behaviour of seq2seq.py is correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants