2017-02-07 8 views
3

変更されていないRNN TensorflowチュートリアルをCentos 7マシンで実行しようとしています。私はyum updateマシンを持っています。 python3.6をインストールし、githubからチュートリアルを取り出し、サンプルデータをダウンロードして解凍しました。他のチュートリアルが実行されます。そして、私が実行します。TensorflowのRNNチュートリアルを実行しているTypeError

python3.6 ptb_word_lm.py --data_path=simple-examples/data/ 

返す:総NOOBとして

Traceback (most recent call last): 
    File "ptb_word_lm.py", line 374, in <module> 
    tf.app.run() 
    File "/usr/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 43, in run 
    sys.exit(main(sys.argv[:1] + flags_passthrough)) 
    File "ptb_word_lm.py", line 334, in main 
    train_input = PTBInput(config=config, data=train_data, name="TrainInput") 
    File "ptb_word_lm.py", line 94, in __init__ 
    data, batch_size, num_steps, name=name) 
    File "/root/tensorflow/models/tutorials/rnn/ptb/reader.py", line 117, in ptb_producer 
    [batch_size, (i + 1) * num_steps]) 
TypeError: strided_slice() missing 1 required positional argument: 'strides' 

を、私は完全に立ち往生しています!誰も助けることができますか?

+0

私はRNNを動作させましたが、Python 3.6とtfバージョン1.0.0-rc1、またはpython 3.5を使用してRNNを管理しました。使用しているTFのバージョンを教えてください。バージョン間でより簡単に切り替えるためにconda環境を使用することをお勧めします – galath

+0

Tensorflowは0.12.1です - 私は 'pip'インストールを使用しました。どうすればアップグレードできますか? – JoeG

答えて

1

上記質問に対するコメントには、TensorFlow 1.0.0rc1がインストールされています。私はpip3.6を使用しますが、私はCentOSにしていたとして、OS Setup guideはそれに対処していないので、私は、各ダウンロードを試してみました:

(tensorflow) [tensorflow]# export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0rc1-cp35-cp35m-linux_x86_64.whl 
(tensorflow) [tensorflow]# pip3.6 install --upgrade $TF_BINARY_URL 
tensorflow-1.0.0rc1-cp35-cp35m-linux_x86_64.whl is not a supported wheel on this platform. 
(tensorflow) [tensorflow]# export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0rc1-cp34-cp34m-linux_x86_64.whl 
(tensorflow) [tensorflow]# pip3.6 install --upgrade $TF_BINARY_URL 
tensorflow-1.0.0rc1-cp34-cp34m-linux_x86_64.whl is not a supported wheel on this platform. 
(tensorflow) [tensorflow]# export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0rc1-cp27-none-linux_x86_64.whl 
(tensorflow) [tensorflow]# pip3.6 install --upgrade $TF_BINARY_URL 
tensorflow-1.0.0rc1-cp27-none-linux_x86_64.whl is not a supported wheel on this platform. 
(tensorflow) [tensorflow]# export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0rc1-cp33-cp33m-linux_x86_64.whl 
(tensorflow) [tensorflow]# pip3.6 install --upgrade $TF_BINARY_URL 
tensorflow-1.0.0rc1-cp33-cp33m-linux_x86_64.whl is not a supported wheel on this platform. 
(tensorflow) [tensorflow]# export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0rc1-cp36-cp36m-linux_x86_64.whl 
(tensorflow) [tensorflow]# pip3.6 install --upgrade $TF_BINARY_URL 
    Collecting tensorflow==1.0.0rc1 from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0rc1-cp36-cp36m-linux_x86_64.whl 
    Downloading https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0rc1-cp36-cp36m-linux_x86_64.whl (43.5MB) 
    100% |████████████████████████████████| 43.5MB 28kB/s 
Requirement already up-to-date: six>=1.10.0 in /usr/lib/python3.6/site-packages (from tensorflow==1.0.0rc1) 
Requirement already up-to-date: wheel>=0.26 in /usr/lib/python3.6/site-packages (from tensorflow==1.0.0rc1) 
Requirement already up-to-date: protobuf>=3.1.0 in /usr/lib/python3.6/site-packages (from tensorflow==1.0.0rc1) 
Requirement already up-to-date: numpy>=1.11.0 in /usr/lib64/python3.6/site-packages (from tensorflow==1.0.0rc1) 
Requirement already up-to-date: setuptools in /usr/lib/python3.6/site-packages (from protobuf>=3.1.0->tensorflow==1.0.0rc1) 
Requirement already up-to-date: packaging>=16.8 in /usr/lib/python3.6/site-packages (from setuptools->protobuf>=3.1.0->tensorflow==1.0.0rc1) 
Requirement already up-to-date: appdirs>=1.4.0 in /usr/lib/python3.6/site-packages (from setuptools->protobuf>=3.1.0->tensorflow==1.0.0rc1) 
Requirement already up-to-date: pyparsing in /usr/lib/python3.6/site-packages (from packaging>=16.8->setuptools->protobuf>=3.1.0->tensorflow==1.0.0rc1) 
Installing collected packages: tensorflow 
    Found existing installation: tensorflow 0.12.1 
    Uninstalling tensorflow-0.12.1: 
     Successfully uninstalled tensorflow-0.12.1 
Successfully installed tensorflow-1.0.0rc1 

のでRHEL/Centosの正しいURLは次のとおりです。tensorflow-1.0.0rc1-cp36-cp36m-linux_x86_64.whl。実行して、アップグレードを確認します。

(tensorflow) [tensorflow]# python3.6 -c 'import tensorflow as tf; print(tf.__version__)' 
1.0.0-rc1 

今すぐ再チュートリアルを実行して、TypeErrorがなくなっていますが、AttributeErrorによって置き換えられます。

(tensorflow) [tensorflow]# python3.6 ptb_word_lm.py --data_path=simple-examples/data/ 
Traceback (most recent call last): 
    ... 
    File "ptb_word_lm.py", line 149, in __init__ 
    output = tf.reshape(tf.concat_v2(outputs, 1), [-1, size]) 
AttributeError: module 'tensorflow' has no attribute 'concat_v2' 

TWO tensorflowのAPIが変更されたことが判明:

  1. concat_v2がなくなり次のように置き換えられます。concat
  2. 同様に、scalar_summaryの名前がsummary.scalarに変更されました。 ptb_word_lm.pyに3つのそのような参照があります

ptb_word_lm.pyを編集して、上記の両方の変更を行い、チュートリアルが正しく実行されるはずです。

関連する問題