본문 바로가기

Enginius/Python&TensorFlow

Install MuJoCo (카브)


https://prj-brain-csi.cloud.kakaobrain.com/login

sungjoon.s.choi@gmail.com


ssh -Y -i ~/.ssh/id_rsa_braincloud-prj-brain-csi -p 1026 root@csi-cluster-gpu21.cloud.kakaobrain.com

http://csi-cluster-gpu21.cloud.kakaobrain.com:1028/




http_proxy_on

mkdir Document

cd Document

mkdir mujuco_related

cd mujuco_related

wget https://www.roboti.us/download/mjpro150_linux.zip

unzip mjpro150_linux.zip

wget https://kakaobrain.slack.com/files/U52HDFMFG/F83083VHS/mjkey.txt

mkdir ./.mujoco

mv mjpro150 ./.mujoco/

mv mjkey.txt ./.mujoco/



apt-get update

apt-get install git

apt-get install -y python-numpy python-dev cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig



cd ~

mkdir github

cd github

git clone https://github.com/openai/gym.git

cd gym

pip install -e '.[all]'


vim ~/.bashrc

add =>

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mjpro150/bin

<==


cd ~

cd github

git clone https://github.com/NixOS/patchelf.git

cd patchelf/

apt-get update

./bootstrap.sh

./configure

make

make install


이러고 나니, 대충 되는 것 같다. 

python

import mujoco_py


자 이제 쥬피터를 설정하자

http_proxy_on

apt-get install screen

pip install jupyter

pip install jupyterthemes

jt -t grade3 -fs 95 -altp -tfs 11 -nfs 115 -cellw 88% -T


screen -S jupyter

jupyter notebook --allow-root --ip=0.0.0.0 --port 1028

or

xvfb-run -s "-screen 0 600x400x24" jupyter notebook --allow-root --ip=0.0.0.0 --port 1028

ctrl + a,d (스크린에서 나오자)


쥬피터 접속은 

csi-cluster-gpu21.cloud.kakaobrain.com:1028

로 하자. 


cd ~

cd github

git clone https://github.com/kyungjaelee/Deep-Reinforcement-Learning.git



cd ~/github/

git clone https://github.com/jakevdp/JSAnimation

cd JSAnimation/

python setup.py install


여기까지 해도 env.render(‘rgb’)

가 되지 않는다…



https://github.com/2017-fall-DL-training-program/Setup_tutorial/blob/master/OpenAI-gym-install.md

위의 링크를 따라해보자. 

nvidia-xconfig -a --cool-bits=4

위 부터 바로 안된다..



____________________________________________________

import gym

env = gym.make('CartPole-v1')

env.reset()

img = env.render('rgb')

____________________________________________________


안된다..


apt-get install lightdm

이걸 해보자. 

reboot


안된다..









카카오브레인에 있는 key를 받았다. 짱짱맨. 이제 시작해보자. 


TF1.8을 사용한다. 

ssh -Y -i ~/.ssh/id_rsa_braincloud-prj-brain-csi -p 1026 root@csi-cluster-gpu11.cloud.kakaobrain.com


아래는 쥬피터 접속

csi-cluster-gpu11.cloud.kakaobrain.com:1028

비번은 adsl


기본적으로 할 것들

http_proxy_on

apt-get update

apt-get install screen


pip install jupyter

pip install jupyterthemes

screen -S jupyter

jt -t grade3 -fs 95 -altp -tfs 11 -nfs 115 -cellw 88% -T

jupyter notebook --allow-root --ip=0.0.0.0 --port 1028


mkdir Document

mkdir github


일단 http://www.mujoco.org/ 에 갔다. 

https://www.roboti.us/download/mjpro150_linux.zip

이걸 써볼까? 


cd Document

mkdir MuJoCo_related

cd MuJoCo_related

일단 프로를 받자. 

wget https://kakaobrain.slack.com/files/U52HDFMFG/F83083VHS/mjkey.txt

wget https://www.roboti.us/download/mjpro150_linux.zip

압축 풀자. 

unzip mjpro150_linux.zip


음.. gym과 연결을 해야하나? 

pip install gym

이것도 하랜다. 

pip install --upgrade pip


그림 그리기 관련해서 

git clone https://github.com/jakevdp/JSAnimation

cd JSAnimation

python3 setup.py install


음 서버에서 그림 그리기 어렵다. 

sudo apt-get install xvfb

일단 위와 같이 고고 

안된다. 


cd MuJoCo_related/

mkdir ~/.mujoco

mv mjpro150 ~/.mujoco

mv mjkey.txt ~/.mujoco


git clone https://github.com/openai/gym.git

cd gym

pip install .[all]

안된다. 

apt-get install swig cmake


다시 시도! 

pip install .[all]

몬가 조금 넘어가는 것 같다. 설치는 된다. 


vim ~/.bashrc

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mjpro150/bin

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/nvidia/lib64


source ~/.bashrc


혹시나 http_proxy_on 이 안되면, 

source /etc/profile.d/deepcloud.sh


흠 몬가 또 안된다? 아래 것들도 깔자 

apt-get install libx11-dev

apt-get install libglew-dev

apt-get install patchelf


아직도 안된다. 

pip install -U 'mujoco-py<1.50.2,>=1.50.1'


Missing GLFW

A common error when installing is:

raise ImportError("Failed to load GLFW3 shared library.")

Which happens when the glfw python package fails to find a GLFW dynamic library.

MuJoCo ships with its own copy of this library, which can be used during installation.

Add the path to the mujoco bin directory to your dynamic loader:

LD_LIBRARY_PATH=$HOME/.mujoco/mjpro150/bin pip install mujoco-py 

This is particularly useful on Ubuntu 14.04, which does not have a GLFW package.


흠 어떻게 할지 잘 모르겠다. 

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mjpro150/bin

위를 .bashrc에 넣어ㅓㅆ다. 안한다.. 


계속 문제다. 

git clone https://github.com/glfw/glfw.git

cd glfw

cmake .

위에가 안먹는다!!