티스토리 뷰

tensorflow-in-windows (2/2)

  • previous post covers
    • install python using anaconda
    • install tensorflow-cpu, which supports cpu only
    • install vs-code, which can be used for editor
  • this post covers
    • install cuda
    • install tensorflow-gpu, which supports gpu too
  • environment
    • Windows / 10
    • Anaconda / 4.6.11

anaconda-and-python

  • I regard you have already followed previous post

  • let us create new virtual environment for installing tensorflow-gpu

cuda

  • tensorflow supports gpu for the faster matrix calculation
    • been gpu specialized for 3d graphics operations, and many portions of the operations are the matrix calculation
  • especially, google's tensorflow team has cooperated with NVIDIA for several years
    • so that is why you should use CUDA for tensorflow-gpu
    • IOW, AMD gpu and Intel IGP cannot be used for tensorflow-gpu

  • visit here to download the installer for CUDA
    • I recommend you to install CUDA its version >= 10.0
    • in this post, I will cover the CUDA 10.0
  • select the proper installer fits your system
    • local installer would be better for general purposes

  • open the executable with compression program
    • ex) bandizip
    • decompress the executable into folder

  • when the decompression is over, execute the setup
    • in this way, each time execution of installer you can avoid generating temporary files for installation
    • while the installing, follow default options

 

  • if you have some errors while installing, follow the instructions below
    • if you have multiple versions of CUDA, uninstall all
    • select custom at the installation options
    • uncheck the options except for CUDA
    • expand the CUDA option and uncheck Visual Studio Integration
    • and now good to go

  • launch the cmd
    • type nvcc and check whether nvcc executes
    • nvcc is used for compiling CUDA codes

cudnn

  • visit here to download the cudnn library as zip file
    • cudnn is acronym of CUda for Deep Neural Network
    • this library includes useful and "essential" features for using tensorflow-gpu
  • "essential" means, without the cudnn you cannot use tensorflow-gpu
    • some import errors would happen

  • decompress the zip and follow the guide
    • in windows, you should place the library files at proper path
    • the proper path would be different upon your CUDA version

  • copy dll file into the path

  • copy header file into the path

  • copy lib file into the path

tensorflow

  • activate the environment we installed
    • type pip install tensorflow-gpu>=1.13.0
    • CUDA 10.0 is supported with 1.13.0 or over

  • you can check whether tensorflow-gpu is successfully installed with python
    • type the command we used in previous post
    • now you can use tensorflow accelerated by gpu

 

  • if you encounter this error, visit here to download latest nvidia graphics driver
    • follow the instructions when we used to install CUDA

  • execute the setup file and keep default settings
    • and retry the test process

'Computer Science > Artificial Intelligence' 카테고리의 다른 글

tensorflow-custom-op (1/2)  (0) 2019.07.07
tensorflow-in-windows (1/2)  (0) 2019.05.31
Introduction to A.I. (5/5)  (0) 2018.11.01
Introduction to A.I. (4/5)  (0) 2018.10.26
Introduction to A.I. (3/5)  (0) 2018.10.19
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함