728x90
반응형

 

 

 

 

 

 

 

환경구축

 

[설치되었다고 가정]

  • Windows 10
  • CUDA 10.0 / cuDNN 7.5.0 
  • Visual Studio 2015
  • Microsoft Visual C++ 2015 Redistributable (x86 and x64) 14.0.24215
  • Microsoft Build Tools 2015 Update 3

[포스팅에서 설치할 것]

  • TensorFlow 1.14
  • MSYS2
  • Bazel 0.25.0
  • Python3.6 ( TensorFlow 빌드 종속성 때문에 설치하는 것)

 

 

 

 

 

1. Python 다운로드

 

TensorFlow 를 소스 빌드 하기 위해서는 Python Dependency 가 필요하기 때문에 Python 을 설치한다.

Python 버전은 3.5.x 또는 3.6.x 버전 64비트 이면 상관 없다. 

 

https://www.python.org/downloads/windows/

 

Python Releases for Windows

The official home of the Python Programming Language

www.python.org

그 다음 아래와 같이 필요한 패키지를 설치합니다. (cmd 이용)

pip3 install six numpy wheel
pip3 install keras_applications==1.0.6 --no-deps
pip3 install keras_preprocessing==1.0.5 --no-deps

Windows 환경에서 주의해야할점은 환경변수를 아주 잘 설정해주어야 한다.

Python 이 설치된 공간을 아래와 같이 시스템 변수인 Path 에 추가해준다.

 

C:\Python\Python36\Scripts\

C:\Python\Python36

 

 

 

 

 

2. Bazel 설치

 

TensorFlow 를 소스 빌드 하기 위해서는 Bazel 이라는 툴을 이용하여 빌드를 수행한다. 

 

설치 사이트 : https://github.com/bazelbuild/bazel/releases/tag/0.25.0

 

bazelbuild/bazel

a fast, scalable, multi-language and extensible build system - bazelbuild/bazel

github.com

관련 이슈 : https://github.com/tensorflow/tensorflow/issues/30556 

 

Bazel 다운로드 사이트에서 아래를 참고하여 TensorFlow 버전에 상응하는 Bazel 버전(.exe)을 설치한다. 

 

  • TF 1.13 wants bazel 0.19.0 to 0.21.0
  • TF 1.14 wants bazel 0.24.1 to 0.25.2
  • TF 2.0 wants bazel 0.24.1 to 0.26.0
  • TF master wants bazel 0.24.1 to 0.26.1

 

본 포스팅에서는 TensorFlow 1.14 를 빌드하기 위하여 Bazel 0.25.0 버전을 설치하였다. 

bazel-0.25.0-windows-x86_64.exe

 

 

 

 

 

 

 

3. MSYS2 다운로드

 

MSYS2 는 TensorFlow를 빌드하는데 필요한 bin 도구를 위해 설치하는 것이다. 

 

설치 사이트 : https://www.msys2.org

 

MSYS2 homepage

MSYS2 is a software distro and building platform for Windows At its core is an independent rewrite of MSYS, based on modern Cygwin (POSIX compatibility layer) and MinGW-w64 with the aim of better interoperability with native Windows software. It provides a

www.msys2.org

위와 같이 두번째 파일을 다운받아준다. 그 다음 환경설정은 Bazel 설정과 같이 진행한다.

 

 

 

 

 

 

4. Bazel + MSYS2 설정

 

4.1 Bazel 환경변수 설정

 

각 BAZEL_SH, BAZEL_VC, BAZEL_VS 라는 변수를 추가 한 뒤 아래와 같이 설정해준다. 

Visual Studio 설치 위치를 확인하여 아래와 같이 추가한다. 

 

  • BAZEL_SH -> C:\msys64\usr\bin\bash.exe
  • BAZEL_VC -> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
  • BAZEL_VS -> C:\Program Files (x86)\Microsoft Visual Studio 14.0

 

4.2 MSYS2 환경변수 설정

 

시스템 변수 PATH 에 추가

  • C:\msys64\usr\bin
  • C:\msys64

 

4.3 MSYS2 MinGW 64-bit 를 실행하여 필요한 패키지 설치 

 

이 패키지 설치가 잘 설치 되었는지 반드시 확인해야하며, 패키지가 설치가 안되었을 경우에

Bazel 빌드를 한참 하다가 오류가 나버린다.

$ pacman -S git patch unzip

 

 

4.4 bazel.exe 파일 옮기기 

 

bazel 다운로드 후 bazel-0.25.0-windows-x86_64.exe 이름을 bazel.exe 로 변경하여 

C:\msys64 에 넣어준다. 

 

 

 

 

 

5. TensorFlow 소스 다운로드

 

MSYS2 패키지를 설치하면 git 패키지가 자동으로 설치된다. 

TensorFlow 소스 코드를 두고자 하는 폴더에 cmd 로 접근 한 뒤 다운로드를 받는다.

$ git clone https://github.com/tensorflow/tensorflow.git
$ cd tensorflow

 

그 다음 빌드할 브랜치를 체크아웃 한다. 

본 포스팅에서는 1.14 버전을 기준으로 함으로 다음과 같이 설정한다.

$ git checkout r1.14

 

다른 브랜치는 아래를 참고

https://github.com/tensorflow/tensorflow/releases

 

tensorflow/tensorflow

An Open Source Machine Learning Framework for Everyone - tensorflow/tensorflow

github.com

 

 

 

 

 

6. 빌드를 위한 설정 (Configure)

 

방금 다운로드 받은 TensorFlow 폴더에 진입한 뒤, configure.py 를 실행한다.

아래와 같이 설정해준다. 입력이 없는 것은 기본 값으로 설정하겠다는 의미로 엔터를 쳐준다. 

C:\tensorflow>configure.py

WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
You have bazel 0.25.0 installed.
Please specify the location of python. [Default is C:\Python\Python36\python.exe]:


Found possible Python library paths:
  C:\Python\Python36\lib\site-packages
Please input the desired Python library path to use.  Default is [C:\Python\Python36\lib\site-packages]

Do you wish to build TensorFlow with XLA JIT support? [y/N]: N
No XLA JIT support will be enabled for TensorFlow.

Do you wish to build TensorFlow with ROCm support? [y/N]: N
No ROCm support will be enabled for TensorFlow.

Do you wish to build TensorFlow with CUDA support? [y/N]: Y
CUDA support will be enabled for TensorFlow.

Found CUDA 10.0 in:
    C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/lib/x64
    C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/include
Found cuDNN 7 in:
    C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/lib/x64
    C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/include


Please specify a list of comma-separated CUDA compute capabilities you want to build with.
You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.
Please note that each additional compute capability significantly increases your build time and binary size, and that TensorFlow only supports compute capabilities >= 3.5 [Default is: 3.5,7.0]:


Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is /arch:AVX]:


Would you like to override eigen strong inline for some C++ compilation to reduce the compilation time? [Y/n]: Y
Eigen strong inline overridden.

Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
        --config=mkl            # Build with MKL support.
        --config=monolithic     # Config for mostly static monolithic build.
        --config=gdr            # Build with GDR support.
        --config=verbs          # Build with libverbs support.
        --config=ngraph         # Build with Intel nGraph support.
        --config=numa           # Build with NUMA support.
        --config=dynamic_kernels        # (Experimental) Build kernels into separate shared objects.
Preconfigured Bazel build configs to DISABLE default on features:
        --config=noaws          # Disable AWS S3 filesystem support.
        --config=nogcp          # Disable GCP support.
        --config=nohdfs         # Disable HDFS support.
        --config=noignite       # Disable Apache Ignite support.
        --config=nokafka        # Disable Apache Kafka support.
        --config=nonccl         # Disable NVIDIA NCCL support.



 

 

 

 

 

 

7. .dll 빌드 

 

cmd 에서 아래 명령어를 실행한다. 아래 명령어는 오로지 C++ 버전으로 TensorFlow 를 빌드하겠다는 의미이다. 

$ bazel build --config=cuda tensorflow:tensorflow.dll

 

(참고) 시중에 나와있는 흔한 TensorFlow 빌드 명령어는 아래와 같다

Python 버전도 같이 설치되기 때문에 C++ 버전만을 필요로 한다면 이를 치면 안된다.

$ bazel build //tensorflow/tools/pip_package:build_pip_package

 

 

빌드 시간은 약 20~30 분 소요된다. 

 

Target //tensorflow:tensorflow.dll up-to-date:
  C:/users/이름/_bazel_이름/xv6zejqw/execroot/org_tensorflow/bazel-out/x64_windows-opt/bin/tensorflow/tensorflow.dll
INFO: Elapsed time: 2495.403s, Critical Path: 343.67s
INFO: 3983 processes: 3983 local.
INFO: Build completed successfully, 6110 total actions

 

 

빌드가 된 결과는 아래와 같은 폴더에 생기며, 

 

C:\Users\이름\_bazel_이름\xv6zejvsx

 

dll 파일은 아래 폴더에 위치해있다.

 

C:/users/이름/_bazel_이름/xv6zejvsx/execroot/org_tensorflow/bazel-out/x64_windows-opt/bin/tensorflow/tensorflow.dll 


 

 

 

 

 

 

8. 버그? 오류를 위한 설정하기

 

원래 dll 을 빌드하고나서 바로 lib 를 빌드하여 VS 에서 사용하면 되는데, 

이를 바로 사용하고자 할 때 외부 기호를 찾을 수 없다는 에러가 잔뜩 나오게 된다. 

 

심각도 코드 설명 프로젝트 파일 줄 비표시 오류(Suppression) 상태
오류 LNK2019 "class std::basic_ostream<char,struct std::char_traits > & __cdecl tensorflow::operator<<(class std::basic_ostream<char,struct std::char_traits > &,class tensorflow::Status const &)" (??6tensorflow@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV12@AEBVStatus@0@@Z) 외부 기호(참조 위치: "class std::basic_ostream<char,struct std::char_traits > & __cdecl std::operator<<<char,struct std::char_traits,class tensorflow::Status>(class std::basic_ostream<char,struct std::char_traits > &&,class tensorflow::Status const &)" (??$?6DU?$char_traits@D@std@@VStatus@tensorflow@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@$$QEAV10@AEBVStatus@tensorflow@@@Z) 함수)에서 확인하지 못했습니다. tensorflow_project c:\Users\sss\documents\visual studio 2015\Projects\tensorflow_project\tensorflow_project\tf.obj 1

심각도 코드 설명 프로젝트 파일 줄 비표시 오류(Suppression) 상태
오류 LNK2019 "class std::basic_string<char,struct std::char_traits,class std::allocator > __cdecl tensorflow::strings::StrCat(class tensorflow::strings::AlphaNum const &,class tensorflow::strings::AlphaNum const &,class tensorflow::strings::AlphaNum const &)" (?StrCat@strings@tensorflow@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVAlphaNum@12@00@Z) 외부 기호(참조 위치: "class tensorflow::Status __cdecl tensorflow::errors::NotFound,class std::allocator >,char const *>(char const *,class std::basic_string<char,struct std::char_traits,class std::allocator >,char const *)" (??$NotFound@PEBDV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBD@errors@tensorflow@@YA?AVStatus@1@PEBDV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z) 함수)에서 확인하지 못했습니다. tensorflow_project c:\Users\sss\documents\visual studio 2015\Projects\tensorflow_project\tensorflow_project\tf.obj 1

심각도 코드 설명 프로젝트 파일 줄 비표시 오류(Suppression) 상태
오류 LNK2019 "class tensorflow::Session * __cdecl tensorflow::NewSession(struct tensorflow::SessionOptions const &)" (?NewSession@tensorflow@@YAPEAVSession@1@AEBUSessionOptions@1@@Z) 외부 기호(참조 위치: "class tensorflow::Status __cdecl LoadGraph(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::unique_ptr > *)" (?LoadGraph@@YA?AVStatus@tensorflow@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAV?$unique_ptr@VSession@tensorflow@@U?$default_delete@VSession@tensorflow@@@std@@@4@@Z) 함수)에서 확인하지 못했습니다. tensorflow_project c:\Users\sss\documents\visual studio 2015\Projects\tensorflow_project\tensorflow_project\tf.obj 1

심각도 코드 설명 프로젝트 파일 줄 비표시 오류(Suppression) 상태
오류 LNK2019 "public: __cdecl tensorflow::internal::LogMessage::LogMessage(char const *,int,int)" (??0LogMessage@internal@tensorflow@@QEAA@PEBDHH@Z) 외부 기호(참조 위치: "class std::vector<float,class std::allocator > __cdecl run_graph(class tensorflow::Session *,class std::vector<float,class std::allocator >)" (?run_graph@@YA?AV?$vector@MV?$allocator@M@std@@@std@@PEAVSession@tensorflow@@V12@@Z) 함수)에서 확인하지 못했습니다. tensorflow_project c:\Users\sss\documents\visual studio 2015\Projects\tensorflow_project\tensorflow_project\tf.obj 1

심각도 코드 설명 프로젝트 파일 줄 비표시 오류(Suppression) 상태
오류 LNK2019 "public: __cdecl tensorflow::Status::Status(enum tensorflow::error::Code,class absl::string_view)" (??0Status@tensorflow@@QEAA@W4Code@error@1@Vstring_view@absl@@@Z) 외부 기호(참조 위치: "class tensorflow::Status __cdecl tensorflow::errors::NotFound,class std::allocator >,char const *>(char const *,class std::basic_string<char,struct std::char_traits,class std::allocator >,char const *)" (??$NotFound@PEBDV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBD@errors@tensorflow@@YA?AVStatus@1@PEBDV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z) 함수)에서 확인하지 못했습니다. tensorflow_project c:\Users\sss\documents\visual studio 2015\Projects\tensorflow_project\tensorflow_project\tf.obj 1

심각도 코드 설명 프로젝트 파일 줄 비표시 오류(Suppression) 상태
오류 LNK2019 "private: void __cdecl cv::String::deallocate(void)" (?deallocate@String@cv@@AEAAXXZ) 외부 기호(참조 위치: "public: __cdecl cv::String::~String(void)" (??1String@cv@@QEAA@XZ) 함수)에서 확인하지 못했습니다. tensorflow_project c:\Users\sss\documents\visual studio 2015\Projects\tensorflow_project\tensorflow_project\main2.obj 1

심각도 코드 설명 프로젝트 파일 줄 비표시 오류(Suppression) 상태
오류 LNK2019 "class tensorflow::Session * __cdecl tensorflow::NewSession(struct tensorflow::SessionOptions const &)" (?NewSession@tensorflow@@YAPEAVSession@1@AEBUSessionOptions@1@@Z) 외부 기호(참조 위치: main 함수)에서 확인하지 못했습니다. tensorflow_project c:\Users\sss\documents\visual studio 2015\Projects\tensorflow_project\tensorflow_project\main2.obj 1

 

 

 

 

이 때 아래와 같이 build script 를 수정하는 방법도 있지만,

 

1.如果是vs无法解析的外部符号,这样解决,错误与解决方案如下(为了能清):
2.如果powershell编译出现无法解析的外部符号

tf_exported_symbols_msvc.lds

LIBRARY tensorflow_cc
EXPORTS
    ??0MetaGraphDef@tensorflow@@QEAA@XZ
    ??1MetaGraphDef@tensorflow@@UEAA@XZ
    ??0LogMessageFatal@internal@tensorflow@@QEAA@PEBDH@Z
    ??1LogMessageFatal@internal@tensorflow@@UEAA@XZ
    ??0CheckOpMessageBuilder@internal@tensorflow@@QEAA@PEBD@Z
    ??1CheckOpMessageBuilder@internal@tensorflow@@QEAA@XZ
    ?ForVar2@CheckOpMessageBuilder@internal@tensorflow@@QEAAPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ
    ?NewString@CheckOpMessageBuilder@internal@tensorflow@@QEAAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ
    ?GetVarint32PtrFallback@core@tensorflow@@YAPEBDPEBD0PEAI@Z
    ?ToString@Status@tensorflow@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ
    ?SlowCopyFrom@Status@tensorflow@@AEAAXPEBUState@12@@Z
    ?_GraphDef_default_instance_@tensorflow@@3VGraphDefDefaultTypeInternal@1@A
    ?NewSession@tensorflow@@YA?AVStatus@1@AEBUSessionOptions@1@PEAPEAVSession@1@@Z
    ??0SessionOptions@tensorflow@@QEAA@XZ
    ??1ConfigProto@tensorflow@@UEAA@XZ
    ?ReadBinaryProto@tensorflow@@YA?AVStatus@1@PEAVEnv@1@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAVMessageLite@protobuf@google@@@Z
    ?Default@Env@tensorflow@@SAPEAV12@XZ
    ?CheckIsAlignedAndSingleElement@Tensor@tensorflow@@AEBAXXZ
    ?_SaverDef_default_instance_@tensorflow@@3VSaverDefDefaultTypeInternal@1@A
    ?CheckTypeAndIsAligned@Tensor@tensorflow@@AEBAXW4DataType@2@@Z
    ??1Tensor@tensorflow@@QEAA@XZ
    ??0Tensor@tensorflow@@QEAA@W4DataType@1@AEBVTensorShape@1@@Z
    ??0?$TensorShapeBase@VTensorShape@tensorflow@@@tensorflow@@QEAA@XZ
    ??0?$TensorShapeBase@VTensorShape@tensorflow@@@tensorflow@@QEAA@V?$Span@$$CB_J@absl@@@Z
    ?DestructorOutOfLine@TensorShapeRep@tensorflow@@AEAAXXZ
    ?TfCheckOpHelperOutOfLine@tensorflow@@YAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVStatus@1@PEBD@Z
    ?DebugString@Tensor@tensorflow@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ
    ?SlowCopyFrom@TensorShapeRep@tensorflow@@AEAAXAEBV12@@Z
    ?dim_size@?$TensorShapeBase@VTensorShape@tensorflow@@@tensorflow@@QEBA_JH@Z
    ?CheckDimsEqual@TensorShape@tensorflow@@AEBAXH@Z
    ?CheckDimsAtLeast@TensorShape@tensorflow@@AEBAXH@Z

    ??0Tensor@tensorflow@@QEAA@XZ
    ??0GraphDef@tensorflow@@QEAA@XZ
    ??1GraphDef@tensorflow@@UEAA@XZ
    
    ?CheckType@Tensor@tensorflow@@AEBAXW4DataType@2@@Z
    ?CopyFromInternal@Tensor@tensorflow@@AEAAXAEBV12@AEBVTensorShape@2@@Z
    ??1NodeDef@tensorflow@@UEAA@XZ
    ??0NodeDef@tensorflow@@QEAA@AEBV01@@Z
	
	
	
	
	
    ??1LogMessage@internal@tensorflow@@UEAA@XZ


    ?NewSession@tensorflow@@YAPEAVSession@1@AEBUSessionOptions@1@@Z

 

 

 

 

 

 

lib 를 빌드하기 전에 session 소스코드를 수정하여 

다시 lib 만 빌드하는 방법이 있다. (참고자료 2 참조)

 

 

 

8.1 session.h 파일 수정

 

다운받은 tensorflow 소스 폴더에서 session.h 파일을 수정해준다. 

tensorflow\core\public\session.h

 

각 위치에 TF_EXPORT 추가

 

86번째 줄

class Session {
 public:
  TF_EXPORT Session();
  virtual ~Session();

 

242번째 줄

TF_EXPORT Status NewSession(const SessionOptions& options, Session** out_session);

 

279번째 줄

TF_EXPORT Session* NewSession(const SessionOptions& options);

 

 

 

 

8.2 session_options.h 파일 수정

 

tensorflow\core\public\session_options.h

 

29번째 줄

TF_EXPORT struct SessionOptions {

 

61번째 줄

  TF_EXPORT SessionOptions();

 

 

 

 

 

 

 

9. .lib 빌드

 

.lib 빌드는 아래 명령어와 같다. 

$ bazel build --config=cuda tensorflow:tensorflow.lib

 

이는 위의 dll 빌드보다 오래걸리지 않는다. 아래 위치에 lib 파일이 생긴다.

 

 C:/users/이름/_bazel_이름/xv6zejvsx/execroot/org_tensorflow/bazel-out/x64_windows-opt/bin/tensorflow/tensorflow.lib

 

 

 

 

 

 

 

 

9. Visual Studio 2015에 .lib 및 .dll 추가하여 프로젝트 설정하기 

 

여기서 주의해야할 점은 bazel 소스 빌드 된 파일들을 함부로 복붙하면 안된다. 

바로가기 링크들이 숨어있어서... 복사가 안되기 때문에 복사할 때 일일이 복사해주어야함 

 

또한 protobuf / eigen / com_google_absl 패키지들이 필요함 (이미 빌드 되어있을 것임)

 

 

 

c++

 

../external/com_google_absl

../external/protobuf_archive/src

../execroot/org_tensorflow/bazel-out/x64_windows-opt/bin

../external/eigen_archive

 

 

linker

 

C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/lib/x64

../execroot/org_tensorflow/bazel-out/x64_windows-opt/bin/tensorflow

 

 

linker input

 

tensorflow.lib

 

 

tensorflow.dll 파일은 visual studio 프로젝트 폴더에서 x64/Debug or x64/Release 폴더에 넣어준다

Project_temp\x64\Debug

 

 

 

 

 

 

 

10. 만약에  C4996 에러가 날 경우에는 전처리기 추가 

 

심각도 코드 설명 프로젝트 파일 줄 비표시 오류(Suppression) 상태 
오류 C4996 'std::swap_ranges::_Unchecked_iterators::_Deprecate': Call to 'std::swap_ranges' with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators' tensorflow_project c:\program files (x86)\microsoft visual studio 14.0\vc\include\algorithm 887

 

전처리기 추가

COMPILER_MSVC 
NOMINMAX 
PLATFORM_WINDOWS 
_CRT_SECURE_NO_WARNINGS 
_SCL_SECURE_NO_WARNINGS

 

 

 

 

 

또한 위와 같은 명령어 이외에도 아래와 같은 명령어로 빌드 할 수도 있다. 

 

bazel build -c opt --config=cuda //tensorflow:libtensorflow_cc.so 



이럴 경우에는 .lib .dll 파일의 확장자가 생기지 않아서 아래와 같이 변경해주어서 사용해야한다. 


libtensorflow_cc.so -> tensorflow_cc.dll 
liblibtensorflow_cc.so.ifso -> tensorflow_cc.lib 

 

 

 

 

 

 

 

 

 

 

참고자료 1 : https://www.tensorflow.org/install/source_windows

 

Windows의 소스에서 빌드  |  TensorFlow

소스에서 TensorFlow pip 패키지를 빌드하고 Windows에 설치합니다. 참고: 철저히 테스트되어 사전 빌드된 Windows 시스템용 TensorFlow 패키지가 이미 제공되고 있습니다. Windows용 설정 다음 빌드 도구를 설치하여 Windows 개발 환경을 구성합니다. Python 및 TensorFlow 패키지 종속성 설치 Windows용 Python 3.5.x 또는 Python 3.6.x 64비트 출시를 설치합니다. 선택적 기능으로 pip

www.tensorflow.org

 

참고자료 2 (처음부터 끝까지 잘 정리되어 있음): https://github.com/sitting-duck/stuff/tree/master/ai/tensorflow/build_tensorflow_1.14_source_for_Windows

 

sitting-duck/stuff

code stuff. Contribute to sitting-duck/stuff development by creating an account on GitHub.

github.com

 

참고자료 3 : session.h 에러 이슈

https://github.com/tensorflow/tensorflow/issues/23542

https://github.com/tensorflow/tensorflow/issues/30647

 

 

참고자료 4 : session.h 파일을 고치지 않고, build script 를 고쳐서 실행하는 방법 

https://github.com/guikarist/tensorflow-windows-build-script

 

guikarist/tensorflow-windows-build-script

A script to automate building Tensorflow on Windows and solve some problems - guikarist/tensorflow-windows-build-script

github.com

 

참고자료 5 : build script 를 수정하여 tensorflow 1.13 또는 1.12 를 빌드하는 방법 

 

TensorFlow 1.13

https://blog.csdn.net/qq_35975447/article/details/91986142

불러오는 중입니다...

 

TensorFlow 1.12

https://blog.csdn.net/atpalain_csdn/article/details/97945536#Step4_tensorflow_110

불러오는 중입니다...

 

참고자료 6 : dependency 조사

http://www.dependencywalker.com/

불러오는 중입니다...

 

728x90
반응형