質問編集履歴

1

エラー文追加

2020/05/05 06:53

投稿

hoshikawa
hoshikawa

スコア6

test CHANGED
File without changes
test CHANGED
@@ -96,7 +96,135 @@
96
96
 
97
97
 
98
98
 
99
-
99
+ ### エラー文
100
+
101
+ ```
102
+
103
+ ---------------------------------------------------------------------------
104
+
105
+ ValueError Traceback (most recent call last)
106
+
107
+ <ipython-input-92-de7e8c320f1e> in <module>()
108
+
109
+ ----> 1 perturbations = create_adversarial_pattern(image, label)
110
+
111
+
112
+
113
+ 7 frames
114
+
115
+ <ipython-input-90-cf00bcaaa5e1> in create_adversarial_pattern(input_image, input_label)
116
+
117
+ 34 # print(input_image)
118
+
119
+ 35 print(gradient)
120
+
121
+ ---> 36 signed_grad = tf.sign(gradient)
122
+
123
+ 37 return signed_grad
124
+
125
+
126
+
127
+ /usr/local/lib/python3.6/dist-packages/tensorflow/python/util/dispatch.py in wrapper(*args, **kwargs)
128
+
129
+ 178 """Call target, and fall back on dispatchers if there is a TypeError."""
130
+
131
+ 179 try:
132
+
133
+ --> 180 return target(*args, **kwargs)
134
+
135
+ 181 except (TypeError, ValueError):
136
+
137
+ 182 # Note: convert_to_eager_tensor currently raises a ValueError, not a
138
+
139
+
140
+
141
+ /usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/math_ops.py in sign(x, name)
142
+
143
+ 578 tf.math.sign(x.values, ...), x.dense_shape).
144
+
145
+ 579 """
146
+
147
+ --> 580 x = ops.convert_to_tensor(x)
148
+
149
+ 581 if x.dtype in (dtypes.complex64, dtypes.complex128):
150
+
151
+ 582 return gen_math_ops.div_no_nan(
152
+
153
+
154
+
155
+ /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py in convert_to_tensor(value, dtype, name, as_ref, preferred_dtype, dtype_hint, ctx, accepted_result_types)
156
+
157
+ 1339
158
+
159
+ 1340 if ret is None:
160
+
161
+ -> 1341 ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
162
+
163
+ 1342
164
+
165
+ 1343 if ret is NotImplemented:
166
+
167
+
168
+
169
+ /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/constant_op.py in _constant_tensor_conversion_function(v, dtype, name, as_ref)
170
+
171
+ 319 as_ref=False):
172
+
173
+ 320 _ = as_ref
174
+
175
+ --> 321 return constant(v, dtype=dtype, name=name)
176
+
177
+ 322
178
+
179
+ 323
180
+
181
+
182
+
183
+ /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/constant_op.py in constant(value, dtype, shape, name)
184
+
185
+ 260 """
186
+
187
+ 261 return _constant_impl(value, dtype, shape, name, verify_shape=False,
188
+
189
+ --> 262 allow_broadcast=True)
190
+
191
+ 263
192
+
193
+ 264
194
+
195
+
196
+
197
+ /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/constant_op.py in _constant_impl(value, dtype, shape, name, verify_shape, allow_broadcast)
198
+
199
+ 268 ctx = context.context()
200
+
201
+ 269 if ctx.executing_eagerly():
202
+
203
+ --> 270 t = convert_to_eager_tensor(value, ctx, dtype)
204
+
205
+ 271 if shape is None:
206
+
207
+ 272 return t
208
+
209
+
210
+
211
+ /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/constant_op.py in convert_to_eager_tensor(value, ctx, dtype)
212
+
213
+ 94 dtype = dtypes.as_dtype(dtype).as_datatype_enum
214
+
215
+ 95 ctx.ensure_initialized()
216
+
217
+ ---> 96 return ops.EagerTensor(value, ctx.device_name, dtype)
218
+
219
+ 97
220
+
221
+ 98
222
+
223
+
224
+
225
+ ValueError: Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.
226
+
227
+ ```
100
228
 
101
229
 
102
230