Code Monkey home page Code Monkey logo

deep-learning-tensorflow-book-code's Introduction

『텐서플로로 배우는 딥러닝』 GitHub Repository

[『텐서플로로 배우는 딥러닝』, 솔라리스, 영진닷컴, 2018] 도서의 소스코드입니다.

alt tag

Chapter 2 - 텐서플로우 소개

Chapter 3 - 텐서플로우 기초와 텐서보드

Chapter 4 - 머신러닝 기초 이론들

  • 소프트맥스 회귀(Softmax Regression)를 이용한 MNIST 숫자분류기 (Code) (TF v2 Code) (TF v2 Keras Code)
  • tf.nn.sparse_softmax_cross_entropy_with_logits API를 사용한 소프트맥스 회귀(Softmax Regression)를 이용한 MNIST 숫자분류기 (Code) (TF v2 Code)

Chapter 5 - 인공신경망(Artificial Neural Networks) - ANN

Chapter 6 - 오토인코더(Autoencoder)

Chapter 7 - Convolutional Neural Networks(CNN)

Chapter 8 - Recurrent Neural Networks(RNN)

Chapter 9 - Image Captioning

  • im2txt - Show and Tell 모델 구현 (Code)
  • show_attend_and_tell - Show, Attend and Tell 모델 구현 (TF v2 Keras Code)

Chapter 10 - Semantic Image Segmentation

Chapter 11 - 생성모델(Generative Model) - GAN(Generative Adversarial Networks)

Chapter 12 - 강화학습(Reinforcement Learning)

Chapter 13 - 파인튜닝(Fine-Tuning)과 Pre-Trained 모델을 이용해서 실제 문제 해결하기

  • Inception v3 Retraining을 이용해서 나만의 분류기 만들어보기 (Code)
  • Pre-Trained 모델을 이용해서 Object Detection 수행하기 (Code)

Appendix

  • CNN을 이용한 MNIST 숫자 분류기 구현 + 텐서보드(TensorBoard) (Code)

Revision History

2019-10-27

  • Chapter 6,11 - TensorFlow 2.0 호환 코드 추가 - TF v2 Code

2019-10-18

  • Chapter 4,5,7 - TensorFlow 2.0 호환 코드 추가 - TF v2 Code

2019-10-06

  • Chapter 2,3 - TensorFlow 2.0 호환 코드 추가 - TF v2 Code

deep-learning-tensorflow-book-code's People

Contributors

solaris33 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deep-learning-tensorflow-book-code's Issues

mnist_classification_using_cnn_v2.py 학습하다 멈추는데 원인을 알 수 있을까요?

환경: Windows 10 Pro, Anaconda 4.7.12, tensorflow_gpu 2.0, CUDA 10.0, cuDNN 7.6, VS Code, ...

Ch07-CNN\mnist_classification_using_cnn_v2.py 을 실행하면 다음과 같은 에러가 났습니다.
2019-11-17 23:16:10.058394: E tensorflow/stream_executor/cuda/cuda_dnn.cc:329] Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED

구글링 끝에 코드를 조금 수정하였습니다.

import tensorflow as tf

physical_devices = tf.config.experimental.list_physical_devices('GPU')
assert len(physical_devices) > 0, "Not enough GPU hardware devices available"
tf.config.experimental.set_memory_growth(physical_devices[0], True)

그러고 나서 실행을 했는데 자꾸 학습 루프가 몇번 돌다가 멈춥니다. 혹시 원인을 알 수 있을까요? 아래는 터미널 메시지 입니다.

2019-11-17 23:03:01.436379: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2019-11-17 23:03:01.444401: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2019-11-17 23:03:01.936969: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-11-17 23:03:01.940935: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165] 0
2019-11-17 23:03:01.942486: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0: N
2019-11-17 23:03:01.944481: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6267 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2080 SUPER, pci
bus id: 0000:01:00.0, compute capability: 7.5)
2019-11-17 23:03:02.180284: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2019-11-17 23:03:03.054169: W tensorflow/stream_executor/cuda/redzone_allocator.cc:312] Internal: Invoking ptxas not supported on Windows
Relying on driver to perform ptx compilation. This message will be only logged once.
2019-11-17 23:03:03.099175: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_100.dll
반복(Epoch): 0, 트레이닝 데이터 정확도: 0.100000

final node

실습을 하면서 FCN 코드를 pb파일, tflite 파일로 변환하고 싶은데 마지막 노드, 즉 output node가 무엇인지 모르겠어서 질문을 남깁니다. output node는 어떤 node인가요?

ValueError: Cannot feed value of shape (0,) for Tensor 'input_image:0', which has shape '(?, 224, 224, 3)'에러 해결이 안됩니다

"/" 를 "\" 로 바꾸는 작업을 완료 했는데도 에러가 계속 발생합니다.
Traceback (most recent call last):
File "FCN.py", line 231, in
tf.app.run()
File "C:\Users\user\anaconda3\envs\FCN\lib\site-packages\tensorflow\python\platform\app.py", line 126, in run
_sys.exit(main(argv))
File "FCN.py", line 199, in main
sess.run(train_op, feed_dict=feed_dict)
File "C:\Users\user\anaconda3\envs\FCN\lib\site-packages\tensorflow\python\client\session.py", line 905, in run
run_metadata_ptr)
File "C:\Users\user\anaconda3\envs\FCN\lib\site-packages\tensorflow\python\client\session.py", line 1116, in _run
str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (0,) for Tensor 'input_image:0', which has shape '(?, 224, 224, 3)'

그리고 이러한 에러도 발생하는데 혹시 버전이 안맞아서 그런건가요?
2020-11-02 10:04:31.049834: E T:\src\github\tensorflow\tensorflow\core\util\events_writer.cc:104] Write failed because file could not be opened.

안녕하세요 BatchDatsetReader.py에 대해 질문 드립니다.

해당 코드에 사용 된 scipy.misc.imresize의 경우 scipy 1.3이상 버전에선 작동이 되지 않아

resize_image = misc.imresize(image, [resize_size, resize_size], interp='nearest') 를

resize_image = np.array(Image.fromarray(image).resize([resize_size, resize_size]))
그리고
resize_image = cv2.resize(image, dsize=(resize_size, resize_size), interpolation=cv2.INTER_NEAREST)를 통해서도 적용해 보았는데도 실행이 되지 않았습니다.

혹시 scipy.misc 말고 다른 방법으로 이미지에 변형을 가하는 방법이 있을 까요?

또 해당 코드를 작성하였을 때 기준으로 numpy, tensorflow등 import된 라이브러리들의 버전 사양이 어떻게 되는 건지도 알 수 있을 까요?

새로운 이미지에 대한 segmentation 테스트를 진행할 경우

image_test = Image.open('test.jpg')
image_test = image_test.resize((224, 224))
image_test = np.array(image_test)
image_test = image_test / 255.
image_test= np.reshape(image_test, (1, 224, 224, 3))

pred = sess.run(pred_annotation, feed_dict={image: image_test, keep_probability: 1.0})

학습된 파라미터를 통해 MIT_Scenparsing Data 내부 이미지가 아닌 새로운 이미지 image_test 에 대한 segmentation 예측 값을 얻어내려는 경우엔 위와 같은 sess.run()함수의 인자에 어떻게 줘야 할 지 알 수 있을까요?

안녕하세요 한가지 궁금한게 있어서 질문드립니다

안녕하세요 semantic segmentation을 하려고 책을 구매하여 책에 있는 FCN8s 코드를 돌려보던 중 코드에 자꾸 오류가 뜹니다 ㅜㅜ

VGG 모델과 ADEChallengeData2016.zip 파일까지는 받아지는데 그 이후에 ADEChallengeData2016.zip 에서 압축해제된 사진 파일들이 읽히지가 않습니다 ㅜㅜ
Annotation file not found for ADEChallengeData2016\images\training\ADE_train_00000001 - Skipping << 라는 식으로 자꾸 뜨고.... 해당 폴더에 사진들이 있는데도 자꾸 이런 문구가 뜨면서 학습이 진행이 안됩니다.

파이썬에 대한 지식이 많지는 않지만 아마 read_MITSceneParsingData.py 코드가 잘못된거 같다라는 생각이 듭니다.. 답변해주시면 감사하겠습니다

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.