Powered by Blogger.
  • Home
  • About
  • Contact
facebook instagram pinterest Email

chuckolet's Blog

Musician & Developer


만약 여러분이 브랜치 이름을 잘못 짓고 이미 원격 레포지토리에 푸시 해버렸다면, 다른 사람들이 여러분이 잘못 네이밍한 브랜치 이름 형식을 따라해버서 당신 머리를 아프게 하기 전에 얼른 아래 단계를 따라해보자.
1. local 브랜치 이름을 재설정한다.
당신이 이름을 바꾸고 싶은 브랜치 위에 있다면:
1
git branch -m new-name
당신이 다른 브랜치 위에 있다면:
1
git branch -m old-name new-name
2. 예전 remote 브랜치를 지우고 새 local 브랜치를 push 한다.
1
git push origin :old-name new-name
3. 새 local 브랜치 이름에 맞게 upstream branch를 재설정한다.
해당 브랜치로 변경한 뒤:
1
git push origin -u new-name
Share
Tweet
Pin
Share
No comments

vanhuyz/CycleGAN-TensorFlow 코드로 Colab 한 session으로 실행 했고,

대략 12시간째 학습 중이다. 

너무 느리다는 이슈도 많고, 직접 체감하기에도 그런 것 같아서 

xhujoy/CycleGAN-tensorflow 라는 다른 코드를 사용해봤다.


vanhuyz/CycleGAN-TensorFlow 코드 
runtime설정: Python3 / GPU 



























지인 컴퓨터 사양이

CPU: i7-7700
GPU: 1050ti
RAM: 32GB

인데

github에 있는 cycleGAN-Tensorflow 코드로 학습이 하나 진행되는데 1초 정도 걸린다.

그런데 같은 코드를 내 컴퓨터에서 Colab으로 돌리면 거의 40초가 걸린다.

이번에는 추가로 Colab 창을 켜서 동시에 돌려보기로 했다.

즉, 기존에 돌리던 vanhuyz/CycleGAN-TensorFlow 코드가 계속 학습 되고 있고

동시에 xhujoy/CycleGAN-tensorflow 코드가 TPU 와 GPU 설정으로 하나씩 더 학습되고 있다.



xhujoy/CycleGAN-tensorflow 코드 
runtime설정: Python3 / TPU 



xhujoy/CycleGAN-tensorflow 코드
runtime설정: Python3 / GPU 



xhujoy/CycleGAN-tensorflow 코드
지인 컴퓨터 학습 중인 모습



Share
Tweet
Pin
Share
No comments
Image result for colab


[Colab Tutorial] 1. Colab 구글 드라이브와 연동해서 사용하기


구글 내부에서 jupyter notebook을 개량해서 쓰던 Google Colaboratory(이하 Colab)이 공개됐다.

요즘 비전 관련 딥러닝을 하다보니 내가 가진 노트북으로는 하루 종일 학습해도 끝날 기미가 

보이질 않아서 요즘 핫하다는 Colab을 도입해보기로 결정했다.


아직 대중에게 공개된지 얼마 되지 않기도 했고 기존에 엄청난 분들이 쓰시던거라 그런지

불친절한 부분이 굉장히 많다. 

그래도 빠르게 개선되고 있는중.

ex) Colab과 구글 드라이브와 연동하기


아무튼 사용법을 알아보자.

여러가지 사용법이 있지만 여기서는 구글 드라이브와 연동해서 사용하는 법을 알아보겠다.


1. 구글 드라이브를 켠다.



2. Colab google app을 설치하기 위해 마우스 오른쪽 -> More -> Connect more apps 을 클릭.



3. Colab 을 검색하고 '+ Connect' 버튼 클릭



4. 이제 다시 More에 가보면 Colaboratory가 생겨있다. 클릭.



5. Python type을 설정하고 GPU를 달아주기 위해 Runtime -> Change runtime type 클릭



6. 원하는 Python type과 GPU or TPU를 골라준다.



cf) TPU는 Tensor processing unit의 약자로 딥러닝을 위해 만들어진 GPU보다 좋은거라고한다.
     근데 Colab에서 제공하는 TPU 옵션은 아직 버그가 있다는 얘기도 많고
     GPU도 충분히 좋은 그래픽 카드를 제공하므로(Tesla K80) 필자는 우선 GPU를 선택하겠다.
300...!

100만 대군을 다 때려잡아 버릴 것 같은 숫자다.


7. 고대의 전통에 따라 Hello World!를 찍어보자.



Share
Tweet
Pin
Share
No comments
Image result for python dictionary
파이썬 딕셔너리 사용법이 잘 정리 되어있는 stack overflow 글을 발견했다.

Creating an empty dictionary
data = {}
# OR
data = dict()

Creating a dictionary with initial values

data = {'a':1,'b':2,'c':3}
# OR
data = dict(a=1, b=2, c=3)
# OR
data = {k: v for k, v in (('a', 1),('b',2),('c',3))}

Inserting/Updating a single value

data['a']=1  # Updates if 'a' exists, else adds 'a'
# OR
data.update({'a':1})
# OR
data.update(dict(a=1))
# OR
data.update(a=1)

Inserting/Updating multiple values

data.update({'c':3,'d':4})  # Updates 'c' and adds 'd'

Creating a merged dictionary without modifying originals

data3 = {}
data3.update(data)  # Modifies data3, not data
data3.update(data2)  # Modifies data3, not data2

Deleting items in dictionary

del data[key]  # Removes specific element in a dictionary
data.pop(key)  # Removes the key & returns the value
data.clear()  # Clears entire dictionary

Check if a key is already in dictionary

key in data

Iterate through pairs in a dictionary

for key in data: # Iterates just through the keys, ignoring the values
for key, value in d.items(): # Iterates through the pairs
for key in d.keys(): # Iterates just through key, ignoring the values
for value in d.values(): # Iterates just through value, ignoring the keys

Create a dictionary from 2 lists

data = dict(zip(list_with_keys, list_with_values))
Feel free to add more!

ref - https://stackoverflow.com/a/8381589/7938801
Share
Tweet
Pin
Share
No comments
Newer Posts
Older Posts

About Me

Unknown
View my complete profile

Categories

  • Android (4)
  • AWS (1)
  • Coding Test (3)
  • Computer (5)
  • etc (1)
  • Git (2)
  • JAVA (3)
  • Linux (6)
  • Machine Learning (7)
  • Music (1)
  • PHP (1)
  • Python (8)
  • React Native (1)
  • SQL (1)
  • Web (12)
  • XML (2)
  • 주식 (1)

Popular Posts

  • Solution: CUDA 9.0 설치 실패 오류 (CUDA 9.0 installer failed on windows 10)
  • 만들면서 배우는 리액트 튜토리얼 - 1.리액트의 특징 및 기본 세팅
  • 만들면서 배우는 리액트 튜토리얼 - 2.JSX
  • 에어드로이드(Airdroid) 로컬 연결 모드 접속 방법(원격 연결 모드로만 접속 해결)
  • 우분투 16.04 크롬 설치, 블루 스크린 문제

recent posts

Total Pageviews

Follow Me

  • facebook
  • instagram
  • Google+
  • youtube

Created with by ThemeXpose