Notes on Transitioning to TensorFlow 1.0

Tensorflow 1.0 is awesome, many nice features, including GridLSTM, LayerNormalization, CRF, etc. There is even a transitioning script that helps automatically converts your file from 0.x to 1.x. However, the official transitioning script does not include many changes that need to be made in my previous LSTM code. This post will list the changes that I discovered, and I hope it will make your life easier. If you have other problems, search the function name in the new API, you should find the corresponding new version. Note that sometimes the order of parameters may differ.

Changes
tf.nn.rnn_cell -> tf.contrib.rnn
tf.nn.seq2seq -> tf.contrib.legacy_seq2seq

virtualenv cannot find module in site-packages

My Tensorflow mysteriously failed at the server. Without root access, I have to compile it from the source, to configure the GPU device. The error is module not found. Tried to pip install the module multiple times, but it still does not work. I can see the package in my site-packages directory, changed access to executable, but still not working.

It turns out that, I have set the PYTHONPATH variable in my ~/.bashrc, and pip installed packages to that specified directory. When I was trying to import the package, it could not find from the virtualenv directories. After removed the PYTHONPATH from my ~/.bashrc, everything works like a charm.