model 마지막 출력층 activation에 따른 loss적용
Dense(1, activation='sigmoid') 이면 Loss에서 loss='binary_crossentropy'
Dense(2 이상, activation='softmax') 이면 Loss에서 loss='categorical_crossentropy' (원핫)
또는 loss='sparse_categorical_crossentropy' (원핫X)
아나콘다 가상환경 생성
anaconda prompt 실행
(base) C:\Users\msi>conda create -n tensor python=3.8
(base) C:\Users\msi>conda activate tensor
(tensor) C:\Users\msi>pip list
Package Version
------------ ---------
certifi 2021.10.8
pip 21.2.2
setuptools 61.2.0
wheel 0.37.1
wincertstore 0.2
패키지 설치
(tensor) C:\Users\msi>pip install tensorflow==2.7.0
(tensor) C:\Users\msi>pip install tensorflow-datasets==4.4.0
(tensor) C:\Users\msi>pip install Pillow==8.4.0
(tensor) C:\Users\msi>pip install numpy==1.21.4
(tensor) C:\Users\msi>pip install urllib3
(tensor) C:\Users\msi>pip install pandas==1.3.4
(tensor) C:\Users\msi>pip install scipy==1.7.3
(tensor) C:\Users\msi>pip install matplotlib
(tensor) C:\Users\msi>pip install ipython
가상환경 확인
(tensor) C:\Users\msi>conda env list
# conda environments:
#
base C:\Users\msi\anaconda3
tensor * C:\Users\msi\anaconda3\envs\tensor
tfcert C:\Users\msi\anaconda3\envs\tfcert
PyCharm 에서 가상환경 세팅
설정 - 프로젝트 - Python 인터프리터 - 추가 - Conda 환경