For Beginners

[텐서플로]로 머신러닝 돌리기2 본문

2021 이전 자료들/AI

[텐서플로]로 머신러닝 돌리기2

.log 2019. 7. 25. 15:28
728x90

일단 데이터의 다운로드는 마쳤다.

그러면 이제 이거를 돌려볼 시간이다.

python monodepth_main.py --mode train --model_name my_model --data_path ~/data/KITTI/ \ --filenames_file ~/code/monodepth/utils/filenames/kitti_train_files.txt --log_directory ~/tmp/

자. 돌려본 결과를 보니까, tensorflow가 설치되지 않아서 import구문이 에러가 나는 것을 확인할 수 있었다.

이 경우, 텐서플로를 설치해주면 될 것 같다.

근데 이 코드가 텐서플로 1.0이라는 것만 알지

텐서플로 cpu인지 gpu인지 어떤거를 설치해야 하는지 그거는 잘 모르는데

일단은 설치해보고 문제가 생기면 구글링을 통해서 해결해보도록 하겠다.

 

https://webnautes.tistory.com/1173

 

PyCharm에 TensorFlow 설치하여 사용하는 방법( Windows / Ubuntu )

윈도우/우분투에 설치한 PyCharm에서 텐서플로우 프로그래밍을 시작하기 위해 필요한 작업을 다루고 있습니다. 1. Python 설치(Windows) 2. Python 설치(Ubuntu) 3. PyCharm 설치 ( Windows ) 4. PyCharm 설치 ( U..

webnautes.tistory.com

이분의 팁을 참고하여, 나는 이렇게 입력을 해보겠다.

pip install --upgrade tensorflow-gpu

텐서보드에 대한 에러가 있긴 한데, 텐서플로는 괜찮은 것 같으니까 일단 돌려보도록 하겠다.

음 일단 설치 후 다시 돌려보니까 에러가 난다.

cudnn이라는 라이브러리의 dll파일을 찾을 수 없다는 에러가 뜨길래 일단은 다운로드를 받아보겠다.

 

 

cudnn을 설치하는 거는 일단 알아서 설치 홈피에 들어가자.

4.3. Installing cuDNN on Windows

 

The following steps describe how to build a cuDNN dependent program. In the following sections the CUDA v9.0 is used as example:

  • Your CUDA directory path is referred to as C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
  • Your cuDNN directory path is referred to as <installpath>
  1. Navigate to your <installpath> directory containing cuDNN.
  2. Unzip the cuDNN package.cudnn-9.0-windows7-x64-v7.ziporcudnn-9.0-windows10-x64-v7.zip
  3. Copy the following files into the CUDA Toolkit directory.
    1. Copy <installpath>\cuda\bin\cudnn64_7.dll to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin.
    2. Copy <installpath>\cuda\ include\cudnn.h to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include.
    3. Copy <installpath>\cuda\lib\x64\cudnn.lib to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64.
  4. Set the following environment variables to point to where cuDNN is located. To access the value of the $(CUDA_PATH) environment variable, perform the following steps:
    1. Open a command prompt from the Start menu.
    2. Type Run and hit Enter.
    3. Issue the control sysdm.cpl command.
    4. Select the Advanced tab at the top of the window.
    5. Click Environment Variables at the bottom of the window.
    6. Ensure the following values are set:Variable Name: CUDA_PATH Variable Value: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
  5. Include cudnn.lib in your Visual Studio project.
    1. Open the Visual Studio project and right-click on the project name.
    2. Click Linker > Input > Additional Dependencies.
    3. Add cudnn.lib and click OK

이거보고 하면 되는데, 음 간단하게 설명하자면

 

이렇게 라이브러리를 받는다.

그리고 이 친구를 잘라내서 아래 여기에 붙인다.

이렇게.

그 다음에는 여기 이 파일도 잘라낸다.

잘라내기.

붙여넣기를 한다.

마찬가지. 잘라내기해서

여기다가 이렇게 붙인다.

자 다했으니까 이제 다시 실행해보겠다.

음 일단 라이브러리 에러는 해결했다.

코드 이거 입력해야지 돌아간다.

python monodepth_main.py --mode train --model_name my_model --data_path ./data/KITTI/ --filenames_file ./utils/filenames/kitti_train_files.txt --log_directory ./tmp/

근데 이거를 입력했는데도 depricated에러가 나는 것이다.

그래서 tensorflow 버전으로 1.0으로 다운그레이드를 해주어야 했다. 근데 1.0으로 설치하는 방법을 모르겠어서

일단 서치.

 

아. 이거 텐서플로 1.0이라서 3.5까지만 돌아간다.

3.6인데 하필...

일단 파이썬 reinstall을 하고 다시 시도하는 것을 보여드리겠습니다.

 

시도한 내용의 결말은 거의 이거와 같은데. 파이썬 버전이 안맞아서 안되는 것이라 추론하고

다시 하는 중입니다.

 

https://stackoverflow.com/questions/42351728/tensorflow-installation-on-windows-10-error-not-a-supported-wheel-on-this-plat

 

Tensorflow installation on Windows 10, error 'Not a supported wheel on this platform'

This question is for a Windows 10 laptop. I'm currently trying to install tensorflow, however, when I run: pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/window...

stackoverflow.com

 

 

Comments