質問編集履歴
1
情報を追加しました
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -1,13 +1,65 @@
|
|
|
1
1
|
### 前提・実現したいこと
|
|
2
2
|
|
|
3
3
|
ここに質問の内容を詳しく書いてください。
|
|
4
|
-
(例)PHP(
|
|
4
|
+
(例)PHP(C
|
|
5
|
-
■■な機能を実装中に以下のエラーメッセージが発生しました。
|
|
6
5
|
|
|
7
6
|
### 発生している問題・エラーメッセージ
|
|
8
7
|
|
|
9
8
|
PythonでChainerを用いて画像の判別をするプログラムを作っているのですが、プログラムを実行すると ValueError : too many value to unpack (expected 2) とエラーが出てしまいます。
|
|
10
9
|
おそらくnet.pyで行っているデータセットの作り方に問題があるのかと思いますが、対処法がわかりません。
|
|
10
|
+
|
|
11
|
+
情報が不足しているというご指摘がありましたので、下にエラーメッセージの全文を追加しました。
|
|
12
|
+
|
|
13
|
+
Exception in main training loop: too many values to unpack (expected 2)
|
|
14
|
+
Traceback (most recent call last):
|
|
15
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/training/trainer.py", line 343, in run
|
|
16
|
+
update()
|
|
17
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/training/updaters/standard_updater.py", line 240, in update
|
|
18
|
+
self.update_core()
|
|
19
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/training/updaters/standard_updater.py", line 245, in update_core
|
|
20
|
+
batch = iterator.next()
|
|
21
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/iterators/serial_iterator.py", line 77, in __next__
|
|
22
|
+
batch = [self.dataset[index] for index in indices]
|
|
23
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/iterators/serial_iterator.py", line 77, in <listcomp>
|
|
24
|
+
batch = [self.dataset[index] for index in indices]
|
|
25
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/dataset/dataset_mixin.py", line 67, in __getitem__
|
|
26
|
+
return self.get_example(index)
|
|
27
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/datasets/transform_dataset.py", line 51, in get_example
|
|
28
|
+
in_data = self._dataset[i]
|
|
29
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/dataset/dataset_mixin.py", line 67, in __getitem__
|
|
30
|
+
return self.get_example(index)
|
|
31
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/datasets/image_dataset.py", line 158, in get_example
|
|
32
|
+
path, int_label = self._pairs[i]
|
|
33
|
+
Will finalize trainer extensions and updater before reraising the exception.
|
|
34
|
+
Traceback (most recent call last):
|
|
35
|
+
File "net.py", line 56, in <module>
|
|
36
|
+
trainer.run()
|
|
37
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/training/trainer.py", line 376, in run
|
|
38
|
+
six.reraise(*exc_info)
|
|
39
|
+
File "/usr/lib/python3/dist-packages/six.py", line 703, in reraise
|
|
40
|
+
raise value
|
|
41
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/training/trainer.py", line 343, in run
|
|
42
|
+
update()
|
|
43
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/training/updaters/standard_updater.py", line 240, in update
|
|
44
|
+
self.update_core()
|
|
45
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/training/updaters/standard_updater.py", line 245, in update_core
|
|
46
|
+
batch = iterator.next()
|
|
47
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/iterators/serial_iterator.py", line 77, in __next__
|
|
48
|
+
batch = [self.dataset[index] for index in indices]
|
|
49
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/iterators/serial_iterator.py", line 77, in <listcomp>
|
|
50
|
+
batch = [self.dataset[index] for index in indices]
|
|
51
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/dataset/dataset_mixin.py", line 67, in __getitem__
|
|
52
|
+
return self.get_example(index)
|
|
53
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/datasets/transform_dataset.py", line 51, in get_example
|
|
54
|
+
in_data = self._dataset[i]
|
|
55
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/dataset/dataset_mixin.py", line 67, in __getitem__
|
|
56
|
+
return self.get_example(index)
|
|
57
|
+
File "/home/bigfoot/.local/lib/python3.8/site-packages/chainer/datasets/image_dataset.py", line 158, in get_example
|
|
58
|
+
path, int_label = self._pairs[i]
|
|
59
|
+
ValueError: too many values to unpack (expected 2)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
11
63
|
### 該当のソースコード
|
|
12
64
|
|
|
13
65
|
```python
|