teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

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

2021/11/11 11:28

投稿

TsukaJ
TsukaJ

スコア2

title CHANGED
File without changes
body CHANGED
@@ -8,6 +8,77 @@
8
8
  ### 発生している問題・エラーメッセージ
9
9
 
10
10
  ```
11
+ InvalidType Traceback (most recent call last)
12
+ <ipython-input-4-140080dec570> in <module>()
13
+ 81 img, label = test_dataset.get_example(i)
14
+ 82
15
+ ---> 83 pred = model.predictor(np.expand_dims(img, axis=0))
16
+ 84
17
+ 85 pred = F.softmax(pred)
18
+
19
+ 8 frames
20
+ <ipython-input-4-140080dec570> in __call__(self, x)
21
+ 57
22
+ 58 def __call__(self, x):
23
+ ---> 59 h = F.relu(self.conv1(x))
24
+ 60 h = F.max_pooling_2d(self.bn1(h), 2, 2)
25
+ 61 h = F.relu(self.conv2(x))
26
+
27
+ /usr/local/lib/python3.7/dist-packages/chainer/link.py in __call__(self, *args, **kwargs)
28
+ 285 # forward is implemented in the child classes
29
+ 286 forward = self.forward # type: ignore
30
+ --> 287 out = forward(*args, **kwargs)
31
+ 288
32
+ 289 # Call forward_postprocess hook
33
+
34
+ /usr/local/lib/python3.7/dist-packages/chainer/links/connection/convolution_2d.py in forward(self, x)
35
+ 249 return convolution_2d.convolution_2d(
36
+ 250 x, self.W, self.b, self.stride, self.pad, dilate=self.dilate,
37
+ --> 251 groups=self.groups, cudnn_fast=self.cudnn_fast)
38
+ 252
39
+ 253
40
+
41
+ /usr/local/lib/python3.7/dist-packages/chainer/functions/connection/convolution_2d.py in convolution_2d(x, W, b, stride, pad, cover_all, **kwargs)
42
+ 656 else:
43
+ 657 args = x, W, b
44
+ --> 658 y, = fnode.apply(args)
45
+ 659 return y
46
+
47
+ /usr/local/lib/python3.7/dist-packages/chainer/function_node.py in apply(self, inputs)
48
+ 305
49
+ 306 if configuration.config.type_check:
50
+ --> 307 self._check_data_type_forward(in_data)
51
+ 308
52
+ 309 self.check_layout_forward(input_vars)
53
+
54
+ /usr/local/lib/python3.7/dist-packages/chainer/function_node.py in _check_data_type_forward(self, in_data)
55
+ 453 in_data, 'in_types', False, shapes=in_shapes)
56
+ 454 with type_check.get_function_check_context(self):
57
+ --> 455 self.check_type_forward(in_type)
58
+ 456
59
+ 457 def check_type_forward(self, in_types):
60
+
61
+ /usr/local/lib/python3.7/dist-packages/chainer/functions/connection/convolution_2d.py in check_type_forward(self, in_types)
62
+ 71 x_type.ndim == 4,
63
+ 72 w_type.ndim == 4,
64
+ ---> 73 x_type.shape[1] == w_type.shape[1] * self.groups,
65
+ 74 )
66
+ 75
67
+
68
+ /usr/local/lib/python3.7/dist-packages/chainer/utils/type_check.py in expect(*bool_exprs)
69
+ 562 for expr in bool_exprs:
70
+ 563 assert isinstance(expr, Testable)
71
+ --> 564 expr.expect()
72
+ 565
73
+ 566
74
+
75
+ /usr/local/lib/python3.7/dist-packages/chainer/utils/type_check.py in expect(self)
76
+ 495 raise InvalidType(
77
+ 496 '{0} {1} {2}'.format(self.lhs, self.exp, self.rhs),
78
+ --> 497 '{0} {1} {2}'.format(left, self.inv, right))
79
+ 498
80
+ 499
81
+
11
82
  InvalidType:
12
83
  Invalid operation is performed in: Convolution2DFunction (Forward)
13
84