質問編集履歴

2

データセットの設定

2020/08/09 09:52

投稿

yoshhhi
yoshhhi

スコア0

test CHANGED
File without changes
test CHANGED
@@ -136,6 +136,30 @@
136
136
 
137
137
  ```python
138
138
 
139
+ #セータセットの作成
140
+
141
+ from chainer.datasets import LabeledImageDataset
142
+
143
+ horcecow_dataset = LabeledImageDataset(image_and_teacher_label_list)
144
+
145
+
146
+
147
+ #データセットの代入
148
+
149
+ from chainer.datasets import TransformDataset
150
+
151
+ transformed_dataset = TransformDataset(horcecow_dataset, adapt_data_to_convolution2d_format)
152
+
153
+
154
+
155
+ #学習データと検証データを分ける
156
+
157
+ from chainer import datasets
158
+
159
+ train_data, test_data = datasets.split_dataset_random(transformed_dataset, int(len(transformed_dataset) * 0.8), seed=0)
160
+
161
+
162
+
139
163
  import chainer
140
164
 
141
165
  import chainer.functions as F

1

エラーメッセージの詳細

2020/08/09 09:52

投稿

yoshhhi
yoshhhi

スコア0

test CHANGED
File without changes
test CHANGED
@@ -16,7 +16,115 @@
16
16
 
17
17
  #学習の実行セルに発生
18
18
 
19
+ TypeError Traceback (most recent call last)
20
+
21
+ <ipython-input-27-ab3509b1dfc4> in <module>
22
+
23
+ 1 #学習の実行
24
+
25
+ ----> 2 trainer.run()
26
+
27
+
28
+
29
+ ~\Anaconda\envs\project_1\lib\site-packages\chainer\training\trainer.py in run(self, show_loop_exception_msg)
30
+
31
+ 347 f.write('Traceback (most recent call last):\n')
32
+
33
+ 348 traceback.print_tb(sys.exc_info()[2])
34
+
35
+ --> 349 six.reraise(*exc_info)
36
+
37
+ 350 finally:
38
+
39
+ 351 for _, entry in extensions:
40
+
41
+
42
+
43
+ ~\Anaconda\envs\project_1\lib\site-packages\six.py in reraise(tp, value, tb)
44
+
45
+ 701 if value.__traceback__ is not tb:
46
+
47
+ 702 raise value.with_traceback(tb)
48
+
49
+ --> 703 raise value
50
+
51
+ 704 finally:
52
+
53
+ 705 value = None
54
+
55
+
56
+
57
+ ~\Anaconda\envs\project_1\lib\site-packages\chainer\training\trainer.py in run(self, show_loop_exception_msg)
58
+
59
+ 314 self.observation = {}
60
+
61
+ 315 with reporter.scope(self.observation):
62
+
63
+ --> 316 update()
64
+
65
+ 317 for name, entry in extensions:
66
+
67
+ 318 if entry.trigger(self):
68
+
69
+
70
+
71
+ ~\Anaconda\envs\project_1\lib\site-packages\chainer\training\updaters\standard_updater.py in update(self)
72
+
73
+ 173
74
+
75
+ 174 """
76
+
77
+ --> 175 self.update_core()
78
+
79
+ 176 self.iteration += 1
80
+
81
+ 177
82
+
83
+
84
+
85
+ ~\Anaconda\envs\project_1\lib\site-packages\chainer\training\updaters\standard_updater.py in update_core(self)
86
+
87
+ 178 def update_core(self):
88
+
89
+ 179 iterator = self._iterators['main']
90
+
91
+ --> 180 batch = iterator.next()
92
+
93
+ 181 in_arrays = convert._call_converter(self.converter, batch, self.device)
94
+
95
+ 182
96
+
97
+
98
+
99
+ ~\Anaconda\envs\project_1\lib\site-packages\chainer\iterators\multiprocess_iterator.py in __next__(self)
100
+
101
+ 148 if self._prefetch_loop.measure_required():
102
+
103
+ 149 measure_mode = True
104
+
105
+ --> 150 batch, state = self._prefetch_loop.measure(
106
+
107
+ 151 self.dataset_timeout)
108
+
109
+ 152 self._prefetch_loop.launch_thread()
110
+
111
+
112
+
113
+ ~\Anaconda\envs\project_1\lib\site-packages\chainer\iterators\multiprocess_iterator.py in measure(self, dataset_timeout)
114
+
115
+ 449
116
+
117
+ 450 batch = batch_ret[0]
118
+
119
+ --> 451 self.mem_size = max(map(_measure, batch))
120
+
121
+ 452 self._allocate_shared_memory()
122
+
123
+ 453
124
+
125
+
126
+
19
- 'NoneType' object is not iterable
127
+ TypeError: 'NoneType' object is not iterable
20
128
 
21
129
  ```
22
130