質問編集履歴
1
Tracebackを追加しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,5 +1,97 @@
|
|
1
1
|
閲覧ありがとうございます。kerasでmnistのオートエンコードの多層化を試していたところ、不明なエラーが出てしまったため、質問いたしました。回答いただけると幸いです。
|
2
2
|
|
3
|
+
```Traceback
|
4
|
+
in <module>()
|
5
|
+
27 decoder_layer = autoencoder.layers[-1]
|
6
|
+
28 # encodeされた画像データを再構成する部分
|
7
|
+
---> 29 decoder = Model(encoded_input, decoder_layer(encoded_input))
|
8
|
+
30
|
9
|
+
31 # AdaDeltaで最適化, loss関数はbinary_crossentropy
|
10
|
+
|
11
|
+
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/base_layer.py in __call__(self, *args, **kwargs)
|
12
|
+
968 if _in_functional_construction_mode(self, inputs, args, kwargs, input_list):
|
13
|
+
969 return self._functional_construction_call(inputs, args, kwargs,
|
14
|
+
--> 970 input_list)
|
15
|
+
971
|
16
|
+
972 # Maintains info about the `Layer.call` stack.
|
17
|
+
|
18
|
+
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/base_layer.py in _functional_construction_call(self, inputs, args, kwargs, input_list)
|
19
|
+
1106 # Check input assumptions set after layer building, e.g. input shape.
|
20
|
+
1107 outputs = self._keras_tensor_symbolic_call(
|
21
|
+
-> 1108 inputs, input_masks, args, kwargs)
|
22
|
+
1109
|
23
|
+
1110 if outputs is None:
|
24
|
+
|
25
|
+
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/base_layer.py in _keras_tensor_symbolic_call(self, inputs, input_masks, args, kwargs)
|
26
|
+
838 return nest.map_structure(keras_tensor.KerasTensor, output_signature)
|
27
|
+
839 else:
|
28
|
+
--> 840 return self._infer_output_signature(inputs, args, kwargs, input_masks)
|
29
|
+
841
|
30
|
+
842 def _infer_output_signature(self, inputs, args, kwargs, input_masks):
|
31
|
+
|
32
|
+
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/base_layer.py in _infer_output_signature(self, inputs, args, kwargs, input_masks)
|
33
|
+
878 self._maybe_build(inputs)
|
34
|
+
879 inputs = self._maybe_cast_inputs(inputs)
|
35
|
+
--> 880 outputs = call_fn(inputs, *args, **kwargs)
|
36
|
+
881
|
37
|
+
882 self._handle_activity_regularization(inputs, outputs)
|
38
|
+
|
39
|
+
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/layers/core.py in call(self, inputs)
|
40
|
+
1240 self.kernel, ids, weights, combiner='sum')
|
41
|
+
1241 else:
|
42
|
+
-> 1242 outputs = gen_math_ops.MatMul(a=inputs, b=self.kernel)
|
43
|
+
1243 # Broadcast kernel to inputs.
|
44
|
+
1244 else:
|
45
|
+
|
46
|
+
/usr/local/lib/python3.7/dist-packages/tensorflow/python/util/tf_export.py in wrapper(*args, **kwargs)
|
47
|
+
402 'Please pass these args as kwargs instead.'
|
48
|
+
403 .format(f=f.__name__, kwargs=f_argspec.args))
|
49
|
+
--> 404 return f(**kwargs)
|
50
|
+
405
|
51
|
+
406 return tf_decorator.make_decorator(f, wrapper, decorator_argspec=f_argspec)
|
52
|
+
|
53
|
+
/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/gen_math_ops.py in mat_mul(a, b, transpose_a, transpose_b, name)
|
54
|
+
5716 _, _, _op, _outputs = _op_def_library._apply_op_helper(
|
55
|
+
5717 "MatMul", a=a, b=b, transpose_a=transpose_a, transpose_b=transpose_b,
|
56
|
+
-> 5718 name=name)
|
57
|
+
5719 _result = _outputs[:]
|
58
|
+
5720 if _execute.must_record_gradient():
|
59
|
+
|
60
|
+
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/op_def_library.py in _apply_op_helper(op_type_name, name, **keywords)
|
61
|
+
748 op = g._create_op_internal(op_type_name, inputs, dtypes=None,
|
62
|
+
749 name=scope, input_types=input_types,
|
63
|
+
--> 750 attrs=attr_protos, op_def=op_def)
|
64
|
+
751
|
65
|
+
752 # `outputs` is returned as a separate return value so that the output
|
66
|
+
|
67
|
+
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/func_graph.py in _create_op_internal(self, op_type, inputs, dtypes, input_types, name, attrs, op_def, compute_device)
|
68
|
+
599 return super(FuncGraph, self)._create_op_internal( # pylint: disable=protected-access
|
69
|
+
600 op_type, captured_inputs, dtypes, input_types, name, attrs, op_def,
|
70
|
+
--> 601 compute_device)
|
71
|
+
602
|
72
|
+
603 def capture(self, tensor, name=None, shape=None):
|
73
|
+
|
74
|
+
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/ops.py in _create_op_internal(self, op_type, inputs, dtypes, input_types, name, attrs, op_def, compute_device)
|
75
|
+
3563 input_types=input_types,
|
76
|
+
3564 original_op=self._default_original_op,
|
77
|
+
-> 3565 op_def=op_def)
|
78
|
+
3566 self._create_op_helper(ret, compute_device=compute_device)
|
79
|
+
3567 return ret
|
80
|
+
|
81
|
+
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/ops.py in __init__(self, node_def, g, inputs, output_types, control_inputs, input_types, original_op, op_def)
|
82
|
+
2040 op_def = self._graph._get_op_def(node_def.op)
|
83
|
+
2041 self._c_op = _create_c_op(self._graph, node_def, inputs,
|
84
|
+
-> 2042 control_input_ops, op_def)
|
85
|
+
2043 name = compat.as_str(node_def.name)
|
86
|
+
2044
|
87
|
+
|
88
|
+
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/ops.py in _create_c_op(graph, node_def, inputs, control_inputs, op_def)
|
89
|
+
1881 except errors.InvalidArgumentError as e:
|
90
|
+
1882 # Convert to ValueError for backwards compatibility.
|
91
|
+
-> 1883 raise ValueError(str(e))
|
92
|
+
1884
|
93
|
+
1885 return c_op
|
94
|
+
```
|
3
95
|
```Error
|
4
96
|
ValueError: Dimensions must be equal, but are 32 and 128 for '{{node dense_5/MatMul}} = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false](Placeholder, dense_5/MatMul/ReadVariableOp)' with input shapes: [?,32], [128,784].
|
5
97
|
```
|