質問編集履歴

1

カーネルの再起動、input_shapeの変更を行いましたが、エラーは取れませんでした

2020/06/01 14:48

投稿

cognac_n
cognac_n

スコア1

test CHANGED
File without changes
test CHANGED
@@ -28,55 +28,15 @@
28
28
 
29
29
  ```
30
30
 
31
+ もともと出ていたエラー
32
+
31
33
  ValueError Traceback (most recent call last)
32
34
 
33
35
  <ipython-input-66-94ca9aad4ee1> in <module>
34
36
 
35
37
  ----> 1 history = model.fit(X_train, Y_train, batch_size = batch_size, epochs = epochs)
36
38
 
37
-
38
-
39
- D:\Anaconda3\envs\tensorflow-gpu-2\lib\site-packages\tensorflow\python\keras\engine\training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, max_queue_size, workers, use_multiprocessing, **kwargs)
40
-
41
- 1534 steps_name='steps_per_epoch',
42
-
43
- 1535 steps=steps_per_epoch,
44
-
45
- -> 1536 validation_split=validation_split)
46
-
47
- 1537
48
-
49
- 1538 # Prepare validation data.
50
-
51
-
52
-
53
- D:\Anaconda3\envs\tensorflow-gpu-2\lib\site-packages\tensorflow\python\keras\engine\training.py in _standardize_user_data(self, x, y, sample_weight, class_weight, batch_size, check_steps, steps_name, steps, validation_split)
54
-
55
- 990 x, y, sample_weight = next_element
56
-
57
- 991 x, y, sample_weights = self._standardize_weights(x, y, sample_weight,
58
-
59
- --> 992 class_weight, batch_size)
60
-
61
- 993 return x, y, sample_weights
62
-
63
- 994
64
-
65
-
66
-
67
- D:\Anaconda3\envs\tensorflow-gpu-2\lib\site-packages\tensorflow\python\keras\engine\training.py in _standardize_weights(self, x, y, sample_weight, class_weight, batch_size)
68
-
69
- 1152 feed_output_shapes,
70
-
71
- 1153 check_batch_axis=False, # Don't enforce the batch size.
72
-
73
- -> 1154 exception_prefix='target')
74
-
75
- 1155
76
-
77
- 1156 # Generate sample-wise weight values given the `sample_weight` and
78
-
79
-
39
+ ~略~
80
40
 
81
41
  D:\Anaconda3\envs\tensorflow-gpu-2\lib\site-packages\tensorflow\python\keras\engine\training_utils.py in standardize_input_data(data, names, shapes, check_batch_axis, exception_prefix)
82
42
 
@@ -96,6 +56,50 @@
96
56
 
97
57
  ```
98
58
 
59
+ ```
60
+
61
+ input_shape=(None, X_train.shape[1], X_train.shape[2]) と、書き換えた場合のエラー
62
+
63
+ ---------------------------------------------------------------------------
64
+
65
+ InvalidArgumentError Traceback (most recent call last)
66
+
67
+ D:\Anaconda3\envs\tensorflow-gpu-2\lib\site-packages\tensorflow\python\framework\ops.py in set_shape(self, shape)
68
+
69
+ 557 dim_list,
70
+
71
+ --> 558 unknown_shape)
72
+
73
+ 559 except errors.InvalidArgumentError as e:
74
+
75
+
76
+
77
+ InvalidArgumentError: Shapes must be equal rank, but are 3 and 2
78
+
79
+
80
+
81
+ During handling of the above exception, another exception occurred:
82
+
83
+ ~略~
84
+
85
+ D:\Anaconda3\envs\tensorflow-gpu-2\lib\site-packages\tensorflow\python\framework\ops.py in set_shape(self, shape)
86
+
87
+ 559 except errors.InvalidArgumentError as e:
88
+
89
+ 560 # Convert to ValueError for backwards compatibility.
90
+
91
+ --> 561 raise ValueError(str(e))
92
+
93
+ 562
94
+
95
+ 563 @property
96
+
97
+
98
+
99
+ ValueError: Shapes must be equal rank, but are 3 and 2
100
+
101
+ ```
102
+
99
103
 
100
104
 
101
105
  ### 該当のソースコード
@@ -182,6 +186,20 @@
182
186
 
183
187
 
184
188
 
189
+ いただいた回答やコメントをもとに試したことは以下です
190
+
191
+ ・jupyter notebookカーネルの再起動
192
+
193
+ ->エラー内容に変化なし
194
+
195
+ ・input_shape=(None, X_train.shape[1], X_train.shape[2]) と、書き換え
196
+
197
+ ->モデルのレイヤー積み上げ段階でエラーが出るようになりました。
198
+
199
+  エラー内容を追記いたします。
200
+
201
+
202
+
185
203
  ### 補足情報(FW/ツールのバージョンなど)
186
204
 
187
205
 
@@ -191,3 +209,5 @@
191
209
  python = 3.6.10
192
210
 
193
211
  tensorflow-gpu = 1.12.0
212
+
213
+ エディタ:jupyter notebook