nlintz / TensorFlow-Tutorials

Simple tutorials using Google's TensorFlow Framework
6.01k stars 1.51k forks source link

Fixed tensorflow 0.9 API compatibility #46

Closed j-min closed 8 years ago

j-min commented 8 years ago

Fixed tensorflow 0.9 API compatibility

  1. replaced "from tensorflow.models.rnn import rnn, rnn_cell" with "tf.nn.rnn_cell"
  2. added state_is_tuple=True (https://www.tensorflow.org/versions/r0.9/api_docs/python/nn.html#recurrent-neural-networks)
  3. using dtype=tf.float32 instead of init_state
hunkim commented 8 years ago

Travis failed. Can you check? Thanks.

j-min commented 8 years ago

According to https://github.com/nlintz/TensorFlow-Tutorials/blob/master/.travis.yml this repository is based on tensorflow 0.8.0 environment where rnn modules do not accept 'state_is_tuple' argument.

install:

  - pip install numpy
  - pip install matplotlib
  # install TensorFlow from https://storage.googleapis.com/tensorflow/
  - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
      pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl;
    elif [[ "$TRAVIS_PYTHON_VERSION" == "3.4" ]]; then
      pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl;'

One of the reason I made this commit is that not using 'state_is_tuple' makes error

WARNING:tensorflow:<tensorflow.python.ops.rnn_cell.BasicLSTMCell object at 0x101e360b8>: Using a concatenated state is slower and will soon be deprecated. Use state_is_tuple=True.

Can we update our travis environment?

hunkim commented 8 years ago

Can you just change 0.8to 0.9 in travis file? On Fri, Jul 22, 2016 at 4:13 PM Jaemin Cho notifications@github.com wrote:

According to https://github.com/nlintz/TensorFlow-Tutorials/blob/master/.travis.yml this repository is based on tensorflow 0.8.0 environment where rnn modules do not accept 'state_is_tuple' argument.

' - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl ; elif [[ "$TRAVIS_PYTHON_VERSION" == "3.4" ]]; then pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl; '

One of the reason I made this commit is that not using 'state_is_tuple' makes error WARNING:tensorflow:<tensorflow.python.ops.rnn_cell.BasicLSTMCell object at 0x101e360b8>: Using a concatenated state is slower and will soon be deprecated. Use state_is_tuple=True.

Can we update our travis environment?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/nlintz/TensorFlow-Tutorials/pull/46#issuecomment-234471414, or mute the thread https://github.com/notifications/unsubscribe-auth/AA3DVyOkj95_flOS6z2d7JEjPE6m4HDyks5qYG2NgaJpZM4JSVFx .

j-min commented 8 years ago

Ok I'll just make another PR including both of the files changed

j-min commented 8 years ago

I think we first need to merge .travis.yml separately, so that Travis CI can actually check if new 07_lstm.py can work properly on the new version of tensorflow.

hunkim commented 8 years ago

Looks good.