質問編集履歴

1

エラーメッセージの追加修正

2021/11/11 11:28

投稿

TsukaJ
TsukaJ

スコア2

test CHANGED
File without changes
test CHANGED
@@ -18,6 +18,148 @@
18
18
 
19
19
  ```
20
20
 
21
+ InvalidType Traceback (most recent call last)
22
+
23
+ <ipython-input-4-140080dec570> in <module>()
24
+
25
+ 81 img, label = test_dataset.get_example(i)
26
+
27
+ 82
28
+
29
+ ---> 83 pred = model.predictor(np.expand_dims(img, axis=0))
30
+
31
+ 84
32
+
33
+ 85 pred = F.softmax(pred)
34
+
35
+
36
+
37
+ 8 frames
38
+
39
+ <ipython-input-4-140080dec570> in __call__(self, x)
40
+
41
+ 57
42
+
43
+ 58 def __call__(self, x):
44
+
45
+ ---> 59 h = F.relu(self.conv1(x))
46
+
47
+ 60 h = F.max_pooling_2d(self.bn1(h), 2, 2)
48
+
49
+ 61 h = F.relu(self.conv2(x))
50
+
51
+
52
+
53
+ /usr/local/lib/python3.7/dist-packages/chainer/link.py in __call__(self, *args, **kwargs)
54
+
55
+ 285 # forward is implemented in the child classes
56
+
57
+ 286 forward = self.forward # type: ignore
58
+
59
+ --> 287 out = forward(*args, **kwargs)
60
+
61
+ 288
62
+
63
+ 289 # Call forward_postprocess hook
64
+
65
+
66
+
67
+ /usr/local/lib/python3.7/dist-packages/chainer/links/connection/convolution_2d.py in forward(self, x)
68
+
69
+ 249 return convolution_2d.convolution_2d(
70
+
71
+ 250 x, self.W, self.b, self.stride, self.pad, dilate=self.dilate,
72
+
73
+ --> 251 groups=self.groups, cudnn_fast=self.cudnn_fast)
74
+
75
+ 252
76
+
77
+ 253
78
+
79
+
80
+
81
+ /usr/local/lib/python3.7/dist-packages/chainer/functions/connection/convolution_2d.py in convolution_2d(x, W, b, stride, pad, cover_all, **kwargs)
82
+
83
+ 656 else:
84
+
85
+ 657 args = x, W, b
86
+
87
+ --> 658 y, = fnode.apply(args)
88
+
89
+ 659 return y
90
+
91
+
92
+
93
+ /usr/local/lib/python3.7/dist-packages/chainer/function_node.py in apply(self, inputs)
94
+
95
+ 305
96
+
97
+ 306 if configuration.config.type_check:
98
+
99
+ --> 307 self._check_data_type_forward(in_data)
100
+
101
+ 308
102
+
103
+ 309 self.check_layout_forward(input_vars)
104
+
105
+
106
+
107
+ /usr/local/lib/python3.7/dist-packages/chainer/function_node.py in _check_data_type_forward(self, in_data)
108
+
109
+ 453 in_data, 'in_types', False, shapes=in_shapes)
110
+
111
+ 454 with type_check.get_function_check_context(self):
112
+
113
+ --> 455 self.check_type_forward(in_type)
114
+
115
+ 456
116
+
117
+ 457 def check_type_forward(self, in_types):
118
+
119
+
120
+
121
+ /usr/local/lib/python3.7/dist-packages/chainer/functions/connection/convolution_2d.py in check_type_forward(self, in_types)
122
+
123
+ 71 x_type.ndim == 4,
124
+
125
+ 72 w_type.ndim == 4,
126
+
127
+ ---> 73 x_type.shape[1] == w_type.shape[1] * self.groups,
128
+
129
+ 74 )
130
+
131
+ 75
132
+
133
+
134
+
135
+ /usr/local/lib/python3.7/dist-packages/chainer/utils/type_check.py in expect(*bool_exprs)
136
+
137
+ 562 for expr in bool_exprs:
138
+
139
+ 563 assert isinstance(expr, Testable)
140
+
141
+ --> 564 expr.expect()
142
+
143
+ 565
144
+
145
+ 566
146
+
147
+
148
+
149
+ /usr/local/lib/python3.7/dist-packages/chainer/utils/type_check.py in expect(self)
150
+
151
+ 495 raise InvalidType(
152
+
153
+ 496 '{0} {1} {2}'.format(self.lhs, self.exp, self.rhs),
154
+
155
+ --> 497 '{0} {1} {2}'.format(left, self.inv, right))
156
+
157
+ 498
158
+
159
+ 499
160
+
161
+
162
+
21
163
  InvalidType:
22
164
 
23
165
  Invalid operation is performed in: Convolution2DFunction (Forward)