###前提・実現したいこと
こちらのサイトを参考にtensorflowによる顔判別のプログラムを作成しています。
『ディープラーニングでザッカーバーグの顔を識別するAIを作る②(AIモデル構築編)』
[https://qiita.com/AkiyoshiOkano/items/959006f9298df72a841a]
###発生している問題・エラーメッセージ
上のサイトのコードをGitHubからダンロードし、自分で収集した画像に当てはめて作業を行なっていたのですが、以下のようなエラーメッセージがでます。
The above exception was the direct cause of the following exception: Traceback (most recent call last): File "main.py", line 234, in <module> keep_prob: 0.5}) File "(省略)tensorflow/python/client/session.py", line 368, in run results = self._do_run(target_list, unique_fetch_targets, feed_dict_string) File "(省略)tensorflow/python/client/session.py", line 428, in _do_run target_list) SystemError: <built-in function delete_Status> returned a result with an error set
###該当のソースコード
PYTHON
1 for step in range(FLAGS.max_steps): 2 for i in range(len(train_image)//FLAGS.batch_size): 3 # batch_size分の画像に対して訓練の実行 4 batch = FLAGS.batch_size*i 5 # feed_dictでplaceholderに入れるデータを指定する 6 sess.run(train_op, feed_dict={ 7 images_placeholder: train_image[batch:batch+FLAGS.batch_size], 8 labels_placeholder: train_label[batch:batch+FLAGS.batch_size], 9 keep_prob: 0.5})
よろしくお願いします。
追記です。
python2系で実行したところ以下のようなエラーメッセージになりました。
I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.2 AVX AVX2 FMA WARNING:tensorflow:From (省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/util/tf_should_use.py:107: initialize_all_ variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02. Instructions for updating: Use `tf.global_variables_initializer` instead. WARNING:tensorflow:Passing a `GraphDef` to the SummaryWriter is deprecated. Pass a `Graph` object instead, such as `sess.graph`. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 , 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61] Traceback (most recent call last): File "main.py", line 239, in <module> keep_prob: 0.5}) File "(省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 889, in run run_metadata_ptr) File "(省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1120, in _run feed_dict_tensor, options, run_metadata) File "(省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1317, in _do_run options, run_metadata) File "(省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1336, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 1310720 values, but the requested shape requires a multiple o f 3136 [[Node: fc1/Reshape = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](pool2/MaxPool, fc1/Reshape/shape) ]] Caused by op u'fc1/Reshape', defined at: File "main.py", line 209, in <module> logits = inference(images_placeholder, keep_prob) File "main.py", line 102, in inference h_pool2_flat = tf.reshape(h_pool2, [-1, 7*7*64]) File "(省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 3938, in reshape "Reshape", tensor=tensor, shape=shape, name=name) File "(省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helpe r op_def=op_def) File "(省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2956, in create_op op_def=op_def) File "(省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1470, in __init__ self._traceback = self._graph._extract_stack() # pylint: disable=protected-access InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 1310720 values, but the requested shape requires a multiple of 3136 [[Node: fc1/Reshape = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](pool2/MaxPool, fc1/Reshape/shape) ]]
###補足情報(言語/FW/ツール等のバージョンなど)
python3
tensorflow
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/12/25 10:27
2017/12/25 10:46
2017/12/25 11:14
2017/12/25 11:46
2017/12/25 12:15
2017/12/25 12:27
2017/12/25 12:59