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

回答編集履歴

2

修正

2020/07/01 06:34

投稿

tiitoi
tiitoi

スコア21960

answer CHANGED
@@ -6,4 +6,21 @@
6
6
  ```
7
7
  if f == ".DS_Store":
8
8
  continue
9
+ ```
10
+
11
+ ----
12
+
13
+ ## 変更箇所
14
+
15
+ ```python
16
+ for f in os.listdir("sakura"):
17
+ if f == ".DS_Store":
18
+ continue
19
+ x.append(image.img_to_array(image.load_img("sakura/" + f, target_size=input_shape[:2])))
20
+ y.append(0)
21
+ for f in os.listdir("cosmos"):
22
+ if f == ".DS_Store":
23
+ continue
24
+ x.append(ximage.img_to_array(image.load_img("cosmos/" + f, target_size=input_shape[:2])))
25
+ y.append(1)
9
26
  ```

1

修正

2020/07/01 06:34

投稿

tiitoi
tiitoi

スコア21960

answer CHANGED
@@ -4,6 +4,6 @@
4
4
  消しても勝手にまた作られてしまうので、ループ内に名前が `.DS_Store` だったら無視するという処理を追加してはどうでしょうか
5
5
 
6
6
  ```
7
- if f != ".DS_Store":
7
+ if f == ".DS_Store":
8
8
  continue
9
9
  ```