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

質問編集履歴

3

```に変更

2020/04/21 06:32

投稿

erisawa
erisawa

スコア12

title CHANGED
File without changes
body CHANGED
@@ -6,7 +6,7 @@
6
6
  発生している問題・エラーメッセージ
7
7
 
8
8
  #出力内容(最後のほうにエラーがでています)
9
- '''
9
+ ```
10
10
  ---------2の画像をnumpy形式に変換し、Listに格納中---------
11
11
  ---------7の画像をnumpy形式に変換し、Listに格納中---------
12
12
  ---------8の画像をnumpy形式に変換し、Listに格納中---------
@@ -46,10 +46,10 @@
46
46
  "and {1} targets".format(type_true, type_pred))
47
47
 
48
48
  ValueError: Classification metrics can't handle a mix of multiclass-multioutput and binary targets
49
- '''
49
+ ```
50
50
 
51
51
  #該当のソースコード(test.py)
52
- '''
52
+ ```
53
53
  from sklearn.model_selection import train_test_split
54
54
  import suuji_0420
55
55
  import numpy as np
@@ -76,9 +76,9 @@
76
76
 
77
77
  from sklearn.externals import joblib
78
78
  joblib.dump(mlp,"model.pkl",compress=True)#モデルの保存
79
- '''
79
+ ```
80
80
  #データセット作成コード(suuuji0420)
81
- '''
81
+ ```
82
82
  from PIL import Image
83
83
  import numpy as np
84
84
  import os,glob
@@ -130,7 +130,7 @@
130
130
  suuji=Number(data, target, target_names, images)
131
131
 
132
132
  return suuji
133
- '''
133
+ ```
134
134
  #備考
135
135
  データセット作成時点で問題があるのかそれとも学習時点で問題があるのかすらよくわかりません。
136
136
  ご回答のほどよろしくお願いいたします。

2

コードの"""を'''になおしました。

2020/04/21 06:32

投稿

erisawa
erisawa

スコア12

title CHANGED
File without changes
body CHANGED
@@ -6,7 +6,7 @@
6
6
  発生している問題・エラーメッセージ
7
7
 
8
8
  #出力内容(最後のほうにエラーがでています)
9
- """
9
+ '''
10
10
  ---------2の画像をnumpy形式に変換し、Listに格納中---------
11
11
  ---------7の画像をnumpy形式に変換し、Listに格納中---------
12
12
  ---------8の画像をnumpy形式に変換し、Listに格納中---------
@@ -46,10 +46,10 @@
46
46
  "and {1} targets".format(type_true, type_pred))
47
47
 
48
48
  ValueError: Classification metrics can't handle a mix of multiclass-multioutput and binary targets
49
- """
49
+ '''
50
50
 
51
51
  #該当のソースコード(test.py)
52
- """
52
+ '''
53
53
  from sklearn.model_selection import train_test_split
54
54
  import suuji_0420
55
55
  import numpy as np
@@ -76,9 +76,9 @@
76
76
 
77
77
  from sklearn.externals import joblib
78
78
  joblib.dump(mlp,"model.pkl",compress=True)#モデルの保存
79
- """
79
+ '''
80
80
  #データセット作成コード(suuuji0420)
81
- """
81
+ '''
82
82
  from PIL import Image
83
83
  import numpy as np
84
84
  import os,glob
@@ -130,7 +130,7 @@
130
130
  suuji=Number(data, target, target_names, images)
131
131
 
132
132
  return suuji
133
- """
133
+ '''
134
134
  #備考
135
135
  データセット作成時点で問題があるのかそれとも学習時点で問題があるのかすらよくわかりません。
136
136
  ご回答のほどよろしくお願いいたします。

1

出力内容を修正しました

2020/04/21 05:50

投稿

erisawa
erisawa

スコア12

title CHANGED
File without changes
body CHANGED
@@ -5,8 +5,46 @@
5
5
  自作したデータセットを用いて、test.pyで実行すると、以下のようなエラーが出てきます。
6
6
  発生している問題・エラーメッセージ
7
7
 
8
- #エラー内容
8
+ #出力内容(最後のほうにエラーがでています)
9
9
  """
10
+ ---------2の画像をnumpy形式に変換し、Listに格納中---------
11
+ ---------7の画像をnumpy形式に変換し、Listに格納中---------
12
+ ---------8の画像をnumpy形式に変換し、Listに格納中---------
13
+ ------------リストをnumpy形式に変換中-----------
14
+ Iteration 1, loss = 175.43883525
15
+ Iteration 2, loss = inf
16
+ Iteration 3, loss = inf
17
+ Iteration 4, loss = inf
18
+ Iteration 5, loss = inf
19
+ Iteration 6, loss = inf
20
+ Iteration 7, loss = inf
21
+ Iteration 8, loss = inf
22
+ Iteration 9, loss = inf
23
+ Iteration 10, loss = inf
24
+ Iteration 11, loss = inf
25
+ Iteration 12, loss = inf
26
+ Training loss did not improve more than tol=0.000100 for 10 consecutive epochs. Stopping.
27
+ 精度 0.7
28
+ Traceback (most recent call last):
29
+
30
+ File "<ipython-input-8-a639f0b2b1f0>", line 1, in <module>
31
+ runfile('C:/Users/erifu/Desktop/data0417/test.py', wdir='C:/Users/erifu/Desktop/data0417')
32
+
33
+ File "C:\Users\erifu\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
34
+ execfile(filename, namespace)
35
+
36
+ File "C:\Users\erifu\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
37
+ exec(compile(f.read(), filename, 'exec'), namespace)
38
+
39
+ File "C:/Users/erifu/Desktop/data0417/test.py", line 32, in <module>
40
+ print(metrics.confusion_matrix(data_test,p))
41
+
42
+ File "C:\Users\erifu\Anaconda3\lib\site-packages\sklearn\metrics\classification.py", line 253, in confusion_matrix
43
+ y_type, y_true, y_pred = _check_targets(y_true, y_pred)
44
+
45
+ File "C:\Users\erifu\Anaconda3\lib\site-packages\sklearn\metrics\classification.py", line 81, in _check_targets
46
+ "and {1} targets".format(type_true, type_pred))
47
+
10
48
  ValueError: Classification metrics can't handle a mix of multiclass-multioutput and binary targets
11
49
  """
12
50