TensorFlow 26

Tensorflow 에러 해결: ERROR: After October 2020 you may experience errors when installing or updating packages.

해결방법 pip install tensorflow --use-feature=2020-resolver pip install tensorflow 뒤에 --use-feature=2020-resolver 를 붙인다. 문제 이유 pip를 업그레이드하면서 발생한 문제입니다. This is because pip will change the way that it resolves dependency conflicts. 에러를 보면, pip가 앞으로 dependency 충돌 문제를 해결하는 방법을 바꿨기 때문이라고 합니다. 해결방법은 간단합니다. pip install tensorflow --use-feature=2020-resolver 위를 입력하시면 문제가 해결됩니다. 문제 내용 ERROR: After October 2..

Error 2020.10.29

Keras 이미지 Extract features 및 Feature map 그리기

1. 이미지 features 추출하고, Feature map을 그리기. (with VGG16) keras.io/api/applications/#extract-features-with-vgg16 from tensorflow.keras.applications.vgg16 import VGG16 from tensorflow.keras.preprocessing import image from tensorflow.keras.applications.vgg16 import preprocess_input import matplotlib.pyplot as plt model = VGG16(weights='imagenet', include_top=False) # include_top = False를 하면 Flatten하기 전..

Tensorflow 2020.10.29

Tensorflow 케라스 EfficientNet Finetuning 예제 - 1

Image classification via fine-tuning with EfficientNet Author: Yixing_Fu Date created: 2020/06/30 Last modified: 2020/07/16 Description: imagenet으로 pretrained된 EfficientNet의 Weights를 활용한 Stanford Dogs Classification - Keras - Colab - Github Introduction: what is EfficientNet 2019년 [Tan_and_Le]에 의해 처음 소개된 EfficientNet은 imagenet 분류와 전이학습을 통한 보통의 이미지 분류 모두에서 가장 높은 정확도에 도달한 효율적인 모델입니다. (i.e. requiri..

Tensorflow 2020.10.28

Tensorflow: input_tensor와 input_shape의 차이

tf.keras.applications.InceptionV3( include_top=True, weights="imagenet", input_tensor=None, input_shape=None, pooling=None, classes=1000, classifier_activation="softmax", ) input_shape: 입력받는 이미지의 shape input_tensor: 입력층의 tensor 지정. 입력받는 이미지의 shape에 관계없이 특정 tensor로 지정할수 있음. 공식문서: input_shape will be ignored if the input_tensor is provided 예를 들어, input_shape를 (224, 224, 3)으로 하고 input_tensor을 지정하지 ..

Tensorflow 2020.10.28

Tensorflow Error 해결: Could not load 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found

Window 10 CUDA 10.1 환경에서, tensorflow == 2.3.1를 설치한 후, Could not load dynamic library 'cudnn64_7.dll', dlerror: cudnn64_7.dll not found 에러가 발생하여, GPU가 잡히지 않는 에러가 발생한 경우 해결방법입니다. CUDA 설치 경로에 들어가보면, (제 경우, C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin (각자 설치한 경로로 들어가면 됩니다.)) cudnn64_7.dll이 cudnn64_8.dll 로 되어 있음을 확인할 수 있다. cuDNN ..

Error 2020.10.27

텐서플로우 콜백 함수(tensorflow callback)

https://keras.io/api/callbacks/ Keras documentation: Callbacks API Callbacks API A callback is an object that can perform actions at various stages of training (e.g. at the start or end of an epoch, before or after a single batch, etc). You can use callbacks to: Write TensorBoard logs after every batch of training to moni keras.io 콜백함수가 필요한 이유: 모델이 학습을 시작하면 학습이 완료될 때까지 사람이 할 수 있는게 없습니다. 따라서 이를 해..

Tensorflow 2020.05.16