質問編集履歴

2

python2系での実行結果の追記

2017/12/25 11:13

投稿

poker
poker

スコア14

test CHANGED
File without changes
test CHANGED
@@ -68,6 +68,108 @@
68
68
 
69
69
 
70
70
 
71
+ 追記です。
72
+
73
+
74
+
75
+ python2系で実行したところ以下のようなエラーメッセージになりました。
76
+
77
+ ```ここに言語を入力
78
+
79
+ I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled
80
+
81
+ to use: SSE4.2 AVX AVX2 FMA
82
+
83
+ WARNING:tensorflow:From (省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/util/tf_should_use.py:107: initialize_all_
84
+
85
+ variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
86
+
87
+ Instructions for updating:
88
+
89
+ Use `tf.global_variables_initializer` instead.
90
+
91
+ WARNING:tensorflow:Passing a `GraphDef` to the SummaryWriter is deprecated. Pass a `Graph` object instead, such as `sess.graph`.
92
+
93
+ [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
94
+
95
+ , 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61]
96
+
97
+ Traceback (most recent call last):
98
+
99
+ File "main.py", line 239, in <module>
100
+
101
+ keep_prob: 0.5})
102
+
103
+ File "(省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 889, in run
104
+
105
+ run_metadata_ptr)
106
+
107
+ File "(省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1120, in _run
108
+
109
+ feed_dict_tensor, options, run_metadata)
110
+
111
+ File "(省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1317, in _do_run
112
+
113
+ options, run_metadata)
114
+
115
+ File "(省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1336, in _do_call
116
+
117
+ raise type(e)(node_def, op, message)
118
+
119
+ tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 1310720 values, but the requested shape requires a multiple o
120
+
121
+ f 3136
122
+
123
+ [[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)
124
+
125
+ ]]
126
+
127
+ Caused by op u'fc1/Reshape', defined at:
128
+
129
+ File "main.py", line 209, in <module>
130
+
131
+ logits = inference(images_placeholder, keep_prob)
132
+
133
+ File "main.py", line 102, in inference
134
+
135
+ h_pool2_flat = tf.reshape(h_pool2, [-1, 7*7*64])
136
+
137
+ File "(省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 3938, in reshape
138
+
139
+ "Reshape", tensor=tensor, shape=shape, name=name)
140
+
141
+ 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
142
+
143
+ r
144
+
145
+ op_def=op_def)
146
+
147
+ File "(省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2956, in create_op
148
+
149
+ op_def=op_def)
150
+
151
+ File "(省略)/.pyenv/versions/anaconda2-4.2.0/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1470, in __init__
152
+
153
+ self._traceback = self._graph._extract_stack()
154
+
155
+ # pylint: disable=protected-access
156
+
157
+ InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 1310720 values, but the requested shape requires a multiple of 3136
158
+
159
+ [[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)
160
+
161
+ ]]
162
+
163
+ ```
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
71
173
  ###補足情報(言語/FW/ツール等のバージョンなど)
72
174
 
73
175
  python3

1

参照したブログのリンク化ができていなかったため修正。

2017/12/25 11:13

投稿

poker
poker

スコア14

test CHANGED
File without changes
test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  『ディープラーニングでザッカーバーグの顔を識別するAIを作る②(AIモデル構築編)』
6
6
 
7
- https://qiita.com/AkiyoshiOkano/items/959006f9298df72a841a
7
+ [[https://qiita.com/AkiyoshiOkano/items/959006f9298df72a841a](https://qiita.com/AkiyoshiOkano/items/959006f9298df72a841a)]
8
8
 
9
9
 
10
10