3 글 보임 - 1 에서 3 까지 (총 3 중에서)
-
글쓴이글
-
2024년 1월 28일 18:04 #111676
임규연참가자개고양이 classification 모델을 다 만들고 fit까지 완료한 후에 test1에 담긴 파일을 가지고 테스트를 진행하려고 하는데요. test1에 담긴 파일들도 tf.keras.preprocessing.image_dataset_from_directory로 수치화한 후 predict 진행하려고 하면 이렇게 나오더라고요...
# predict를 위한 test 이미지 수치화
test_ds = tf.keras.preprocessing.image_dataset_from_directory( '/Users/alphastation/repository/learning-AI101/data/dogs-vs-cats/test', image_size = (64, 64) ) numeric_image = test_ds.take(1) prediction = model.predict(numeric_image) print (prediction) >>> [[1.0000000e+00] [1.0000000e+00] [0.0000000e+00] [3.6931902e-02] [1.0000000e+00] [1.0000000e+00] [1.0000000e+00] [1.0000000e+00] [0.0000000e+00] [1.0000000e+00] [1.0000000e+00] [1.0000000e+00] [7.2347391e-13] [0.0000000e+00] [0.0000000e+00] [1.0000000e+00] [0.0000000e+00] [1.0000000e+00] [1.0000000e+00] [1.0000000e+00] [1.0000000e+00] [1.0000000e+00] [1.0000000e+00] [1.0000000e+00] [1.0000000e+00] [0.0000000e+00] [1.0000000e+00] [1.0000000e+00] [0.0000000e+00] [1.0000000e+00] [0.0000000e+00] [0.0000000e+00]] 지금 나온 결과가 predict가 잘 된건가요? 개일 확률, 고양이일 확률로 나와야 하는게 아닌가요? model 코드는 영상에서 나온 코드랑 동일합니다.
2024년 1월 28일 18:04 #111677
임규연참가자model summary한 결과는 아래와 같습니다
Model: "sequential_8" _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= conv2d_17 (Conv2D) (None, 64, 64, 32) 896 max_pooling2d_17 (MaxPooli (None, 32, 32, 32) 0 ng2D) dropout_9 (Dropout) (None, 32, 32, 32) 0 conv2d_18 (Conv2D) (None, 32, 32, 64) 18496 max_pooling2d_18 (MaxPooli (None, 16, 16, 64) 0 ng2D) conv2d_19 (Conv2D) (None, 16, 16, 32) 18464 max_pooling2d_19 (MaxPooli (None, 8, 8, 32) 0 ng2D) dropout_10 (Dropout) (None, 8, 8, 32) 0 flatten_8 (Flatten) (None, 2048) 0 dense_16 (Dense) (None, 128) 262272 dense_17 (Dense) (None, 1) 129 ================================================================= Total params: 300257 (1.15 MB) Trainable params: 300257 (1.15 MB) Non-trainable params: 0 (0.00 Byte) _________________________________________________________________
2024년 1월 29일 09:32 #111727
codingapple키 마스터1e0은 확률이 1이라는 뜻이고 0e0은 확률이 0이라는 뜻입니다 1이랑 0으로 깔끔하게 떨어지는건 약간 이상해보이긴 합니다
-
글쓴이글
3 글 보임 - 1 에서 3 까지 (총 3 중에서)
- 답변은 로그인 후 가능합니다.