質問編集履歴
1
Imageをimageに変えましたが新たなエラーが出ました
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
編集しました。
|
2
|
+
|
1
3
|
画像判定をしたいのですが、途中で
|
2
4
|
|
3
5
|
```
|
4
6
|
|
5
|
-
AttributeError:
|
7
|
+
AttributeError: 'JpegImageFile' object has no attribute 'open'
|
6
8
|
|
7
9
|
|
8
10
|
|
@@ -14,17 +16,11 @@
|
|
14
16
|
|
15
17
|
|
16
18
|
|
17
|
-
```python
|
18
|
-
|
19
|
-
from PIL import Image
|
20
|
-
|
21
|
-
import os,glob
|
22
|
-
|
23
|
-
import numpy as np
|
24
|
-
|
25
|
-
from sklearn.model_selection import train_test_split
|
26
19
|
|
27
20
|
|
21
|
+
|
22
|
+
|
23
|
+
```python
|
28
24
|
|
29
25
|
classes=["monkey","boar","crow"]
|
30
26
|
|
@@ -54,9 +50,9 @@
|
|
54
50
|
|
55
51
|
if i>= 200: break
|
56
52
|
|
57
|
-
image=
|
53
|
+
image=image.open(file)
|
58
54
|
|
59
|
-
image=
|
55
|
+
image=image.convert("RGB")
|
60
56
|
|
61
57
|
image=image.resize(image_size,image_size)
|
62
58
|
|
@@ -66,10 +62,4 @@
|
|
66
62
|
|
67
63
|
Y.append(index)
|
68
64
|
|
69
|
-
|
70
|
-
|
71
|
-
X=np.array(X)
|
72
|
-
|
73
|
-
Y=np.array(Y)
|
74
|
-
|
75
65
|
```
|