saurus2
Saurus2
saurus2
전체 방문자
오늘
어제
  • 분류 전체보기
    • 개발
      • AJAX
    • ML Ops
    • Profile
    • 음식점
    • 배낭여행
    • 컴퓨터공학
      • 알고리즘 공부
      • C++
      • Sever 스터디
      • Java spring
      • 알고리즘 _ 문제해결
      • 딥러닝
      • Java 정리
      • Python
      • LeetCode 1000
      • Machine Learning Study
      • Sign language Detection Pro..
      • LeetCode Solutions
    • 비콘
    • 데일리 리포트
    • 유학일기
      • 영어 공부
      • Daily
    • AI Master Degree
      • Data Mining
      • AI and Data engineering
      • Math Foundations for Decisi..
      • Natural Language Processing

블로그 메뉴

  • 홈
  • 태그
  • 미디어로그
  • 위치로그
  • 방명록

공지사항

인기 글

태그

  • 알고리즘문제해결
  • two pointer
  • c++
  • 취준
  • BFS
  • 개발자 취업준비
  • LeetCode
  • 리트코드
  • DFS
  • 릿코드
  • 알고리즘
  • 문제해결능력
  • 개발자
  • 취업준비
  • 온라인저지
  • 딕셔너리
  • Python
  • 백준
  • 딥러닝
  • 파이썬

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
saurus2

Saurus2

[맥북] 딥러닝 텐서플로 part 3.
컴퓨터공학/딥러닝

[맥북] 딥러닝 텐서플로 part 3.

2021. 4. 19. 15:36

Tensorflow와 파이썬을 최신버전으로 공부하다 보니까, 에러가 많아서
맥북에 anaconda를 설치하고 가상환경에서 작업을 하겠다.

아나콘다 다운 링크 : www.anaconda.com/products/individual

 

Anaconda | Individual Edition

Anaconda's open-source Individual Edition is the easiest way to perform Python/R data science and machine learning on a single machine.

www.anaconda.com

Graphical Installer 다운 후 설치

conda 를 사용하려면, PATH 설정을 해야함. 

~/.bash_profile 에 export PATH="/Users/(유저아이디)/opt/anacaonda3/bin:$PATH" 를 입력하고, source ~/.bash_profile을 해야 
제대로 conda명령어가 작동한다. 

혹시 zsh 를 사용할 경우, ~/.zshrc 를 vi로 열어서, source ~/.bash_profile을 아무곳에다 넣어주자.
그리고 마찬가지로 source .zshrc 를 입력하자.

버전 확인과 가상환경 설정

conda --version
onda create -n tensorflow pip python=3.6

가상환경 설정 & tensorflow 설치

conda init zsh
conda install tensorflow==1.2
conda activate tensorflow
# 에러 발생 후 아래 코드 실행
conda install -c conda-forge tensorflow==1.2.0

 

채널에 텐서플로우가 존재하지 않아 설치가 불가능하다. 

PackagesNotFoundError: The following packages are not available from current channels:

  - tensorflow==1.2.0

이러한 메세지가 나와서 conda install -c conda-forge tensorflow==1.2.0 명령어로 설치했다.

왜그런지 모르겠지만, 설치 후에 python버전이 맞지 않다고 나와서 

conda에서 create로 python==3.6을 다시해주고 나니

Activate가 가능해졌다.

conda install numpy
conda install matplotlib
conda install scipy
conda install -c conda-forge tensorflow==1.2.0
conda install keras
conda deactivate

필요한 프로그램은 모두 설치 완료 후 가상환경 비활성화 

 

파이참과 conda 연결

상단에 Pycharm > Preferences > Python Interpreter > Add Python Interpreter > Conda Environment > Existing environment
여기서 Conda executable을 /Users/(유저 아이디)/opt/anaconda3/bin/conda 로 설정 하고 OK 

/Users/saurus2/opt/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:458: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/Users/saurus2/opt/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:459: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/Users/saurus2/opt/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:460: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/Users/saurus2/opt/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:461: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/Users/saurus2/opt/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:462: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/Users/saurus2/opt/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:465: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])

import후에 실행시 문제가 발생하는데 , python 3.6, tensorflow 1.2 로 설치한상태에서 numpy 최신으로 설치해서 

문제가 발생한듯 하다... 오늘은 여기까지.. 

플레이스홀더와 변수

플레이스홀더 : 그래프에 사용할 입력 값을 나중에 받기 위해 사용 (parameter)
변수 : 학습 함수들이 그래프를 최적화하기 위해 사용하며, 학습한 결과를 갱신할때 사용

 

 

'컴퓨터공학 > 딥러닝' 카테고리의 다른 글

[딥러닝/머신러닝] 넘파이 NumPy, 맷플롯립 Matplotilb  (0) 2021.07.28
딥러닝/머신러닝 개발 환경 구축  (0) 2021.07.26
[맥북] 딥러닝 텐서플로 part 2.  (0) 2021.04.17
[맥북] 딥러닝 텐서플로 part 1.  (0) 2021.04.02
[Yolo v3] Object Detection 물체 인식 오픈소스 darknet 소스 분석  (3) 2018.11.06
    '컴퓨터공학/딥러닝' 카테고리의 다른 글
    • [딥러닝/머신러닝] 넘파이 NumPy, 맷플롯립 Matplotilb
    • 딥러닝/머신러닝 개발 환경 구축
    • [맥북] 딥러닝 텐서플로 part 2.
    • [맥북] 딥러닝 텐서플로 part 1.
    saurus2
    saurus2
    Simple is Best

    티스토리툴바