2 분 소요

https://github.com/robbiebarrat/rapping-neural-network

https://github.com/codebox/markov-text

requirement.txt 에 있는 module update 를 하려는데 아래와 같은 에러가 나는 경우

Traceback (most recent call last):File "/usr/bin/pip3", line 9, in <module>from pip import mainImportError: cannot import name 'main'

해결책

The bug is found in pip 10.0.0.

In linux you need to modify file: /usr/bin/pip from:

from pip import mainif __name__ == '__main__':    sys.exit(main())

to this:

from pip import __main__if __name__ == '__main__':    sys.exit(__main__._main())

문제점

 pronouncing==0.1.2 없는 경우

ubuntu에서 pip 실행시 아래와 같은 에러가 발생한다.

pip install -U -r requirements.txt 

Collecting pronouncing==0.1.2 (from -r requirements.txt (line 1))

  Downloading https://files.pythonhosted.org/packages/52/8a/29b3c1d29829c708dfbb2ef2d56df0506e681cf1fd9415d3c85f0ad0606d/pronouncing-0.1.2.tar.gz (912kB)

    100% ████████████████████████████████ 921kB 694kB/s 

Collecting pyttsx==1.1 (from -r requirements.txt (line 2))

  Downloading https://files.pythonhosted.org/packages/5b/db/45ec294a1776732b80118660ba13389f8178461273e1214d2ae604fa65a7/pyttsx-1.1.tar.gz

Collecting markovify==0.5.4 (from -r requirements.txt (line 3))

  Downloading https://files.pythonhosted.org/packages/ed/d9/3063c780a11d3c29f1831e9c6d82923b05b48ced0b9a8a4a88c02443d108/markovify-0.5.4.tar.gz

Collecting Keras==1.2.2 (from -r requirements.txt (line 4))

  Downloading https://files.pythonhosted.org/packages/75/3e/9926ce5c678b7a7978724a2ecf24857d89a415d152b8d3443e6d45c228b2/Keras-1.2.2.tar.gz (175kB)

    100% ████████████████████████████████ 184kB 1.7MB/s 

Collecting numpy==1.12.1 (from -r requirements.txt (line 5))

  Downloading https://files.pythonhosted.org/packages/f9/d5/f24f86b51298f171826a398efdd64b5214b687a28a2f05ff736b1505b1b2/numpy-1.12.1-cp27-cp27mu-manylinux1_x86_64.whl (16.5MB)

    99% ████████████████████████████████ 16.5MB 1.5MB/s eta 0:00:01Exception:

Traceback (most recent call last):

이후 해결 책으로  mac os에서 도커를 설치하고 keras가 설치된 docker file을 받는다.

https://hub.docker.com/r/gw000/keras/

gimyunlaeuiMBP:~ YOUNLEA$ docker pull gw000/keras

Using default tag: latest

latest: Pulling from gw000/keras

3e731ddb7fc9: Pull complete 

94915074dac9: Pull complete 

908fccbf1630: Pull complete 

748300fc564b: Pull complete 

0bee9d91d0d3: Pull complete 

b97e387f78fb: Pull complete 

Digest: sha256:24dd95d65d9cd908f354e1437e350f46307ca23e4dc1532ea70e1b52aaf192ed

Status: Downloaded newer image for gw000/keras:latest

자.. 이제 실행해 보자구..

gimyunlaeuiMBP:~ YOUNLEA$ docker run -it gw000/keras:latest

root@71455632ac8a:/srv# ls

자.. 다운로드… 및 설치..

17  git clone https://github.com/robbiebarrat/rapping-neural-network.git

18  ls

19  cd rapping-neural-network/

22  pip install -U -r requirements.txt 

설치가 다 됐다.. 허허.. ㅡ.ㅡ; 참나.. 우분투에서 왜 안됐지 ㅜㅜ 데비안에서는 되네.. ㅜㅜ

20180711

http://konlpy.org/ko/v0.4.3/examples/generate/

https://github.com/dyelax/encore.ai    « 새로운 랩만들기

requirement.txt설치시 버젼 이슈..(빌드시 에러)

pronouncing==0.1.2

pyttsx==1.1

markovify==0.5.4

Keras==2.1.6

numpy==1.13.3

root@71455632ac8a:/home/source/rapping-neural-network# python model.py 

Using TensorFlow backend.

_________________________________________________________________

Layer (type)                 Output Shape              Param #   

=================================================================

lstm_1 (LSTM)                (None, 2, 4)              112       

_________________________________________________________________

lstm_2 (LSTM)                (None, 2, 8)              416       

_________________________________________________________________

lstm_3 (LSTM)                (None, 2, 8)              544       

_________________________________________________________________

lstm_4 (LSTM)                (None, 2, 8)              544       

_________________________________________________________________

lstm_5 (LSTM)                (None, 2, 8)              544       

_________________________________________________________________

lstm_6 (LSTM)                (None, 2, 2)              88        

=================================================================

Total params: 2,248

Trainable params: 2,248

Non-trainable params: 0

_________________________________________________________________

Alright, building the list of all the rhymes

LSTM 사용하기 (https://brunch.co.kr/@chris-song/9)

학생들  결과물..

\