https://stackoverflow.com/questions/63329657/python-3-7-error-unsupported-pickle-protocol-5

 

Python 3.7 Error: Unsupported Pickle Protocol 5

I'm trying to restore a pickled config file from RLLib (json didn't work as shown in this post), and getting the following error: config = pickle.load(open(f"{path}/params.pkl", "rb&...

stackoverflow.com

pip install --upgrade --quiet cloudpickle pickle5 라고만 치면 3.7 환경에서도 cloudpickle 5를 쓸 수 있다.

'Experiments' 카테고리의 다른 글

data loader 속도 높이기  (0) 2021.08.09
image encoder batch normalization  (0) 2021.08.01
ResNet & iResNet  (0) 2021.02.11
Imitating Latent Policy from Observation 2  (0) 2020.12.26
Imitating Latent Policy from Observation  (0) 2020.12.11

https://openaccess.thecvf.com/content_ICCV_2017/papers/Huang_Arbitrary_Style_Transfer_ICCV_2017_paper.pdf

 

# Abstract

Gatys et al. 에서 이미지를 다른 스타일로 바꾸는 "style transfer" algorithm을 소개

--> slow iterative optimization process로 인해 현실 세계 적용이 어려움.

Fast approximations with FFNN (feed-forward neural network)는 neural style transfer의 속도를 높이기 위해 제안되었으나 제한된 style만 적용가능. 

이 논문은 arbitrary style을 real-time으로 이미지에 적용하는 첫 논문이고, (AdaIN) adaptive instance normalization layer가 content feature의 mean, variance를 style feature의 mean, variance와 align 시키는 것을 도움으로써 가능케한다. 

이 외에도 content-style trade-off, style interpolation, color & spatial controls과 같은 single feed-forward neural network를 이용하는 많은 기법들을 가능하게 한다.

 

# Introduction

optimization-based framework의 flexibility와 feed-forward approaches의 speed를 합친 논문.

Feed-forward style transfer에서 매우 효율적으로 작동했던 Instance normalization (IN) layer에서 영감을 받았다. 

--> Instance normalization이 feature statistics를 normalize함으로써 style normalization을 수행하는데, 그럼으로써 image의 style information을 뽑아낼 수 있다. 이걸 이용해서 content input과 style input의 mean, variance가 서로 맞오록 조정한다. AdaIN은 transferring feature statistics를 통해 content와 style을 통합한다. 

 

# Related Work

1. Style transfer

non-photo-realistic rendering, texture synthesis and transfer에 뿌리를 두고있다.

이전에는 histogram matching on linear filter responses, non-parametric sampling 등을 이용했지만 low-level statistics에 의존적이다보니 semantic structure를 제대로 캐치 못하는 경우도 있었다. 

Convolutional layer에서 match feature statistics 하는 Gatys가 처음으로 볼만한 결과를 만들었구 Li~ 가 markov random field를 기반으로 하여 local pattern enforce하는 framework도 제안하였다. Ruder가 temporal constraint를 활용함으로써 비디오에서 style transfer하는 것도 해봤다.  

Wang은 multi-resolution architecture를 활용해서 granularity를 높였다.

Chen~이 training 때 보지 않은 arbitrary style을 style swap layer를 이용해 transfer한 경우도 있다. 

--> 이건 content에 가장 가까운 style feature를 patch-by-patch manner로 바꿔주는 역할을 한다. 그래서 시간이 좀 걸림.

 

그럼 loss function은 뭘 이용할까?

match second-order statistics between feature activations, captured by Gram matrix.

이외에도 MRF loss, adversarial loss, histogram loss, CORAL loss, MMD loss, distance between channel-wise mean and variance 가 있다.

--> match feature statistics between style image and synthesized image.

 

2. Deep generative image modeling

variational auto-encoders, auto-regressive models, GAN(generative adversarial networks)이 image generation을 잘하는데, GAN에 conditional generation, multi-stage processing, better training objectives등을 이용하여 더 개선하는 경우도 많다.

GAN도 style transfer나 cross-domain image generation에 쓰이기도 한다. 

 

# Background

1. Batch Normalization (BN)

Ioffe~ 가 제안한, normalizing feature statistics로 feed-forward network의 학습을 굉장히 쉽게해준 그 기술을 Batch Normalization이라고 함.

원래는 discriminative network의 학습을 도와주는 용도였는데, generative image modelling에도 효과만점이다.

즉 NxCxHxW batch가 있을 때 N,H,W에 대해 mean std를 구하는것.

보통 channel은 RGB일테니 mean std를 구함으로써 이미지가 3차원으로 줄어드는 것이다?

보통 mini-batch statistics를 적용하여, training과 inference간 차이를 유도되기도 하는데, Batch renormalization으로 그런 단점을 해결하였다. 또한 BN은 recomputing popular statistics in target domain 함으로써 domain shift를 줄이는 효과를 보이기도 한다.

 

2. Instance Normalization

IN은 channel 뿐만 아니라 각 sample에 대해서도 spatial dimension 정보들이 따로 계산된다.

 

3. Conditional Instance Normalization

learns a different set of parameters gamma and beta for each style s

network can generate images in different styles by using same convolutional parameters but different affine parameters in IN layers.

https://seongkyun.github.io/others/2019/03/05/hdd_mnt/

 

ubuntu 추가 하드디스크 마운트 방법 · Seongkyun Han's blog

ubuntu 추가 하드디스크 마운트 방법 05 Mar 2019 | ubuntu hdd mount ubuntu 추가 하드디스크 마운트 방법 우분투가 설치된 하드디스크 외 추가 하드디스크 마운트 하는 방법에 대해 설명한다. 1. 하드디스

seongkyun.github.io

https://www.itenvoy.com/adding-a-new-drive-to-ubuntu-18-04lts/

 

Adding a New Drive to Ubuntu 18.04LTS - IT Envoy

It’s not every day that you add a new drive to your desktop or server.  And whilst adding a drive to Ubuntu with a GUI is relatively simple, adding a drive from the command line is …. well … pretty simple too actually.  You just have to know the co

www.itenvoy.com

conda activate 해도 which pip 했을 때 원래 환경꺼로 머물러 있는 경우 -  conda deactivate를 한 후 다시 activate 하면 된다.

Hard disk symbolic link:

cd /home/user
sudo ln -s /mnt /home/user
sudo chmod 777 mnt

https://github.com/conda/conda/issues/9392

'Ubuntu and setups' 카테고리의 다른 글

ubuntu disk usage by user  (0) 2021.08.11
ubuntu user 만들기  (0) 2021.07.31
git config temporal username  (0) 2021.07.14
210504 NVIDIA CUDA installation  (0) 2021.05.04
vncserver setting, ssh 터널링 등  (0) 2021.01.25

1. 먼저 nvidia-smi 와 nvcc -V를 해서 둘다 어떤 output도 나오지 않는 클린한 상태를 만들자. 

sudo dpkg -l | grep nvidia
sudo dpkg -l | grep cuda

위 명령어로 잔여 프로그램이 남아있는지를 확인할 수 있고,
지울땐 여러가지 방법이 있지만 밑과 같이 지울 수 있다. <> 괄호 안을 자유자재로 바꿔서 원하는걸 삭제하면 된다.
혹시라도 cuda repository가 남아있는지를 확인하기 위해서 폴더 안으로도 가서 확인하는게 좋다.

sudo apt-get remove --purge <libnvidia-*> 
sudo rm -rf /usr/local/cuda*

https://settembre.tistory.com/447

다 지웠으면 nvidia driver 부터 설치한다. (nvidia-smi)를 위해서

여러가지 방법이 있지만, 나는 밑의 명령어로 어떤 버전 설치 가능한지 확인후에 대강 적절히 높은 숫자 정해서 설치하는 것을 선호한다.

sudo ubuntu-drivers devices
sudo apt-get install nvidia-driver-515

https://goodtogreate.tistory.com/entry/%EC%97%94%EB%B9%84%EB%94%94%EC%95%84NVIDIA-%EA%B7%B8%EB%9E%98%ED%94%BD-%EB%93%9C%EB%9D%BC%EC%9D%B4%EB%B2%84-%EC%9E%AC%EC%84%A4%EC%B9%98-%EB%B0%8F-%EC%97%85%EA%B7%B8%EB%A0%88%EC%9D%B4%EB%93%9C

그런다음에 컴퓨터를 껐다 켜야 nvidia-smi가 잘 작동한다.

nvcc -V를 위해서는 cuda-toolkit을 설치해야하는데, 기본으로 우분투 추천 명령어를 써도 무방하다. - 근데 그러면 가장 최신버전이 설치되므로, 원하는 버전이 있으면 cuda toolkit 버전 검색해서 깔면 된다. - pytorch나 어떤 라이브러리 쓰려면 거기에 적합한걸 설치하면 좋은데, 보통 그럴경우 최신보다는 좀 전의 버전을 깔아야한다.

sudo apt install nvidia-cuda-toolkit

https://linuxconfig.org/how-to-install-cuda-on-ubuntu-20-04-focal-fossa-linux

그런다음에 .bashrc에 path 설정해주면 완료!
official 사이트에서는 run 파일보다 deb 파일 설치를 더 추천한다고 한다! deb 파일이 더 specific 한거여서, 가능하다면 그걸 설치하라고.. 

vim ~/.bashrc
export LD_LIBRARY_PATH=/usr/local/cuda-12.0/lib64\
                         ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export PATH=/usr/local/cuda-12.0/bin${PATH:+:${PATH}}

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions

forums.developer.nvidia.com/t/nvidia-driver-and-cuda-installation-sequence/60456

 

'Ubuntu and setups' 카테고리의 다른 글

ubuntu disk usage by user  (0) 2021.08.11
ubuntu user 만들기  (0) 2021.07.31
git config temporal username  (0) 2021.07.14
mount disk in ubuntu + conda pip errors  (0) 2021.07.05
vncserver setting, ssh 터널링 등  (0) 2021.01.25

ResNet은 CNN이 점점 깊어질 수록 vanishing gradient 의 문제로 인해 오히려 에러가 높아지는 현상을 해결하기 위해 만든 구조로, 밑의 사이트에 설명이 잘 나와있다.

bskyvision.com/644

 

[CNN 알고리즘들] ResNet의 구조

LeNet-5 => https://bskyvision.com/418 AlexNet => https://bskyvision.com/421 VGG-F, VGG-M, VGG-S => https://bskyvision.com/420 VGG-16, VGG-19 => https://bskyvision.com/504 GoogLeNet(inception v1) =>..

bskyvision.com

invertible ResNet은 classification에만 주로 쓰이는 resnet을 generation에서도 쓸수있게 만들자는 건데, Euler's method for ODE initial value problem과 ResNet architecture가 공통점을 가지는 것에서 착안하였다.

 

Lipschitz-constant : 함수의 기울기 최대값이라고 볼 수 있다. 다만 무한히 기울기가 증가하는 함수는 lipschitz continuous 하지 않고, 따라서 lipschitz-constant를 갖지 않는다. 자세한 설명은 밑의 블로그에서.

sanghyeonna.blogspot.com/2018/08/spectral-normalization-part2_30.html

 

Spectral Normalization - part.2

이 정리는 Spectral Normalization  논문에 관한 정리입니다. 이번 포스팅에서는 Lipschitz constant의 정의와 의미 그리고 Spectral Normalization이 무엇이고 이것이 어떻게 Lipschitz constant...

sanghyeonna.blogspot.com

spectral norm: 왜 난 이게 Lipschitz norm이랑 같아 보이냐.. L2이고 linear transformation 일때의 lipschitz norm이랑 다를게 없어보임..!

Banach fixed-point theorem: 

F(x) = x가 되는 점이 하나 이상 존재한다!

Jacobian : 나올때마다 생소한데, 알고보면 친숙한 행렬.

f의 각 요소를 x의 각 요소로 미분한 행렬

SVD (singular value decomposition) : 

angeloyeo.github.io/2019/08/01/SVD.html

1. Mujoco rendering 해결 (video를 찍지 않고 그냥 이미지 저장을 하기로)

github.com/openai/mujoco-py/issues/390

2. VNC 서버 세팅 (tight vnc server가 검은 screen 나오는게 해결이 안돼서 tiger vnc로 바꿈. viewer는 real vnc viewer 쓰는 중. 검은 screen은 dbus 관련 문제인 것 같으나 tiger vnc는 원래 모니터를 잘 켜놓기만 하면 문제없이 돌아가서 해결하지 않음)

z-wony.tistory.com/19

 

Ubuntu 18.04, 20.04 에서 VNC Server 설치하기

tightvnc를 줄곧 썼었는데, 언제부터인지 뜻대로 설정이 되지 않는걸 알았습니다. (잘쓰던게 갑자기 안된건 아니고, 제가 점점 Ubuntu 버젼을 올리면서 시행착오를 겪었습니다.) 설정하고 접속해보

z-wony.tistory.com

https://jjeongil.tistory.com/1332

두번째 포스트는 dbus를 이용하지 않고, xfce4를 이용했다는 점에서 위 포스트와 다르다. 둘 중 어느것이 더 안정적인지는 아직 알 수 없으나 첫번째 포스트는 시행착오가 많았다는 점에서, 두번째 포스트가 더 나은것 같기도!

 

Ubuntu 18.04 : VNC 설치 및 구성하는 방법, 예제, 명령어

이 가이드에서는 Ubuntu 18.04에 VNC 서버를 설치하고 구성하는 데 필요한 단계를 설명합니다. 또한 SSH 터널을 통해 VNC 서버에 안전하게 연결하는 방법도 알려드리겠습니다. VNC(Virtual Network Computing)

jjeongil.tistory.com

3. ubuntu port 관련

sudo lsof -i -P -n | grep LISTEN 이라고 하면 현재 열려있는 포트가 보이고, 잘못 연거는

kill -9 $PID 로 죽일 수 있다.

그리고 서버 텐서보드를 바로 연결할때는 

ssh -NfL $내ip:원하는포트:localhost:그쪽포트 $그쪽ip 이런식으로 치면 된다.

ex) ssh -NfL 147.46.00.00:1234:localhost:8889 zwh@147.46.11.11

 

4. zip 할때 -r 해야 밑의 폴더까지 다 zip 된다.

 

5. nvidia 관련 문제. 일단 keep

askubuntu.com/questions/1280589/usr-bin-nvidia-modprobe-unrecognized-option-s

 

/usr/bin/nvidia-modprobe: unrecognized option: "-s"

nvidia-smi /usr/bin/nvidia-modprobe: unrecognized option: "-s" ERROR: Invalid commandline, please run `/usr/bin/nvidia-modprobe --help` for usage information. /usr/bin/nvidia-modprobe:

askubuntu.com

 

'Ubuntu and setups' 카테고리의 다른 글

ubuntu disk usage by user  (0) 2021.08.11
ubuntu user 만들기  (0) 2021.07.31
git config temporal username  (0) 2021.07.14
mount disk in ubuntu + conda pip errors  (0) 2021.07.05
210504 NVIDIA CUDA installation  (0) 2021.05.04

1. stable-baselines 에서 VecVideoRecorder를 가지고 gym 환경 녹화하기 (mujoco는 안됨. atari랑 classic control만 되더라 - mujoco는 rendering 환경에서 video record하는 거만 되는듯..)

colab.research.google.com/github/araffin/rl-tutorial-jnrr19/blob/master/1_getting_started.ipynb#scrollTo=4efFdrQ7MBvl

 

Google Colaboratory

 

colab.research.google.com

이거는 jupyter나 colab에서 돌릴 때 유용할듯.

이 함수는 gym.wrappers.monitoring의 video_recorder.py를 가지고 만든 함수이다.

또한 GIF를 만든다든지,  official 한 도움은, 밑에서 받을 수 있다.

stable-baselines.readthedocs.io/en/master/guide/examples.html

 

Examples — Stable Baselines 2.10.2a1 documentation

PyBullet: Normalizing input features Normalizing input features may be essential to successful training of an RL agent (by default, images are scaled but not other types of input), for instance when training on PyBullet environments. For that, a wrapper ex

stable-baselines.readthedocs.io

이때 pybox2d를 다시 설치해야할 수도 있고, (swig를 설치하거나) - lunarlander example을 돌릴때

 

2. random 함수는 

import random

random.seed(2)  -> 아무 수나 가능.

random.random() 해서 0과 1사이 수를 얻을 수 있다.

 

3. 16.04에서 이 실험을 재현하다보면 - 설치하다보면, mujoco-py 2.0 이상 버전 설치할 때 patchelf를 설치하라는 얘기를 들을 수 있다. - 근데 개귀찮음. <processing>

 

4. video가 잘 만들어지는지 보기위해 VLC player도 설치하고 ubuntu-restricted-extras도 설치해봄. 근데 gym.videorecorder로 만든거는 재생이 안되더라. gif는 잘 보임.

askubuntu.com/questions/214421/how-to-install-the-mpeg-4-aac-decoder-and-the-h-264-decoder

 

5. custom gym env 만들기 -매우 잘 설명해주신다. 

www.youtube.com/watch?v=kd4RrN-FTWY&t=366s

6. error

 

models/ilpo.py 162 tf.compat.v1.set_random_seed

 

models/image_ilpo.py 41 string_input_producer (tensorflow.python.training.input)->

Queue-based input pipelines have been replaced by `tf.data`. Use `tf.data.Dataset.from_tensor_slices(string_tensor).shuffle(tf.shape(input_tensor, out_type=tf.int64)[0]).repeat(num_epochs)`. If `shuffle=False`, omit the `.shuffle(...)`.

 

models/image_ilpo.py:42: WholeFileReader.__init__ (from tensorflow.python.ops.io_ops) is deprecated and will be removed in a future version. ->

Queue-based input pipelines have been replaced by `tf.data`. Use `tf.data.Dataset.map(tf.read_file)`.

 

models/image_ilpo.py:47: The name tf.assert_equal is deprecated. Please use tf.compat.v1.assert_equal instead.

 

7. from_tensor_slices 함수

www.tensorflow.org/api_docs/python/tf/data/Dataset

 

tf.data.Dataset  |  TensorFlow Core v2.4.0

Represents a potentially large set of elements.

www.tensorflow.org

www.tensorflow.org/api_docs/python/tf/data/Iterator

1. Conda env rename

stackoverflow.com/questions/50198809/is-it-possible-to-list-environments-of-anaconda-with-dates-of-creation

 

Is it possible to list environments of anaconda *with* dates of creation

If you do conda info --envs you get a list of the environments you create in anaconda Is there a way to do this but to get also the dates of creation of these environments?

stackoverflow.com

 

ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

stable-baselines 2.10.0 requires gym[atari,classic_control]>=0.11, but you'll have gym 0.10.5 which is incompatible.
scipy 1.5.2 requires numpy>=1.14.5, but you'll have numpy 1.14.3 which is incompatible.
opencv-python 3.4.5.20 requires numpy>=1.14.5, but you'll have numpy 1.14.3 which is incompatible.
mkl-fft 1.2.0 requires numpy>=1.16, but you'll have numpy 1.14.3 which is incompatible.

 

2. requirements

numpy==1.14.3
setuptools==36.4.0
tensorflow==1.13.1  new!!
gym==0.10.5
baselines==0.1.5
opencv-python==3.4.5.20  new!!
matplotlib==2.2.2
seaborn==0.8.1

3. 함수들

1) eval(x)

x 안에 들어가는 식을 계산해서 output한다. x에 2+3이 들어가면 5를 output 하는 함수

2) os.path.basename, os.path.splitext

basename은 파일명을 반환하고, splitext는 확장자를 뺀 이름을 반환한다.

참고: chess72.tistory.com/132

 

파이썬 Python - OS.PATH 기초 정리

>>> sys.modules.keys() 현재 세션, 또는 프로그램안에서 사용되는 모든 모듈을 보여준다. >>> sys.getrefcount(object) >>> sys.exc_info() returns a tuple with the latest exception's type, value, and trace..

chess72.tistory.com

3) tensorflow.name_scope

name_scope은 변수 안에 변수가 있고 그 안에 관계가 있는 경우 그걸 묶어주는 함수인 것 같다.

예를 들면 answer = alpha+beta, alpha = a+b 일때, 그걸 해주는..? 참고: kamang-it.tistory.com/entry/Tensorflow-07-Name-Scope

 

4) python에서 *와 **

*는 argument를 tuple로 다 받아오는 것, **는 argument를 dictionary 형태로 받아오는 것인듯.

그래서 for item in *args: 라고 쓸 수 있고, for key, value in **kwargs.items(): 라고 할 수 있는듯 하다.

 

5) setattr()

setattr(object, name, value) 는, object.name = value와 유사하다고 보면 된다. 

 

6) tf.train.shuffle_batch()는 www.tensorflow.org/api_docs/python/tf/compat/v1/train/shuffle_batch

paths_batch, inputs_batch, targets_batch = tf.train.shuffle_batch(
[paths, inputs, targets],
batch_size=args.batch_size,
num_threads=1,
enqueue_many=True,  여러개의 example이 input으로 들어가는지 하나인지를 말한다.
capacity=num_samples,
min_after_dequeue=1000)  dequeue 후 남는 최소 수라고 한다. 이게 클수록 shuffle이 많이 된다고.

7) tf.summaray 

scalar 또는 histogram으로 내가 tensorboard에서 보고 싶은 변수를 지정할 수 있다. 

 

8) tf.trainable_variables

이건 어떻게 세팅하는건가? 그냥 tensor면 다 되는건지, 초기에 만들때 tf.Variables로 만들어야 되는건지, tf. function안에 있으면 다 되는건지..?

 

9) tf GPU 탄력적 운영:

goodtogreate.tistory.com/entry/TensorFlow%EB%A5%BC-%EA%B3%B5%EC%9A%A9-GPU%EC%97%90%EC%84%9C-%EC%82%AC%EC%9A%A9-%ED%95%A0-%EB%95%8C-%EB%A9%94%EB%AA%A8%EB%A6%AC-%EC%A0%88%EC%95%BD-%EB%B0%A9%EB%B2%95

 

TensorFlow를 공용 GPU에서 사용 할 때 메모리 절약 방법

TensorFlow를 공용 GPU에서 사용 할 때 메모리 절약 방법 절대적 메모리 uppeor bound 설정 tf.Session 생성 할 때 GPU memory allocation을 지정할 수 있다. 이것을 위해서 tf.GPUOptions 에 config 부분을 아래..

goodtogreate.tistory.com

10) tf.session.run() - tensorflowkorea.gitbooks.io/tensorflow-kr/content/g3doc/api_docs/python/client.html

tf global_step은 checkpoint 저장하는 step 인듯!

 

11) tf-slim은 CNN을 더 간편하게 구현하는 library이다. 

github.com/google-research/tf-slim/blob/master/README.md

 

12) name_scope, variable_scope, arg_scope

group을 만드는 것과 같다. 

name_scope, variable_scope 모두 '길드'라고 보면 편하다. 동일한 이름의 변수가 있어도, 길드가 다르면 다른 변수로 취급하기 쉽듯, scope이 다르면 다른 변수로 디버깅 하기 편하다.

arg_scope은 tf-slim에 등장하는 개념인데, 이것 역시 'python class처럼 상속될경우 같은 함수, 변수를 공유'하는 것과 유사한 개념이라고 생각하면 된다. 동일한 argument를 공유할 경우 한 arg_scope에 있으면, 그 argument가 상속되어 내려오고, 밑에서 다시 overwrite 할수 있다.

 

13) epoch은 그 training data를 모두 한번씩 학습시킬때까지를 1 epoch이라고 한다.

m.blog.naver.com/qbxlvnf11/221449297033

 

14) tf.expand_dims m.blog.naver.com/PostView.nhn?blogId=wideeyed&logNo=221164750517&proxyReferer=https:%2F%2Fwww.google.com%2F

내가 정해주는 axis에 dimension을 하나 늘려준다. 

(2,2) 인데 axis 1에 대해 늘리면, (2,1,2) 가 된다. 

 

15) tf.stop_gradient 

- 두개의 network가 연결되어 있는데, 학습을 따로 진행하고 싶을때 하나의 parameter를 freeze하는 함수이다.

 

16) tf.tile 약간 stack처럼 쌓는건데, 동일한 matrix를 복제하여 쌓는다. 

tf.tile(a, [13]) 은 a를 13번 가로로 붙이는 것이다. [a a a ...] 같이!

 

17) tf. identity()

음 백프로 이해 못했는데, 그 tensor에 대한 reference를 update해야할 때 쓰는 것이라고 한다.

stackoverrun.com/ko/q/9614307

 

TensorFlow에서 tf.identity는 무엇에 사용됩니까?

공식 CIFAR-10 자습서 및 stackoverflow의 배치 정규화 구현과 같이 일부 장소에서 tf.identity이 사용 된 것을 보았습니다.하지만 왜 필요한지 알 수 없습니다. 무엇에 사용됩니까? 누구든지 유스 케이스

stackoverrun.com

18) tf.reset_default_graph()

실험이나 그전거 필요없이 뭔가 다시 시작할때 reset하는 용도로 쓴다고 한다.

 

19) mujoco rendering 관련

wiki.dong-min.kim/view/%EB%8D%94%EB%9F%AC%EC%9A%B4_mujoco_%ED%99%98%EA%B2%BD_%EC%9E%A1%EA%B8%B0

original paper github: github.com/akanazawa/motion_reconstruction 

 

1. pip error

stackoverflow.com/questions/30656046/permission-denied-error-when-using-pip-install-in-virtualenv

sudo chown -R hskim /home/hskim/.cache

 

2.opencv

datanetworkanalysis.github.io/2020/02/20/opencv_pip

pip install opencv-contrib-python

 

3. tensorflow version - cuda version match

https://stackoverflow.com/questions/50622525/which-tensorflow-and-cuda-version-combinations-are-compatible

 

4. pip install opendr==0.77

 

5.

ln -s source_file symbolic_link

ln -sfn /a/new/path files 

cuda 가 cuda-10.2 로 설정되어있을때 cuda-10.0 으로 바꿀때 nvidia-smi가 이미 되는 상태라면 cuda-libraries만 따로 설치해도 무방할듯. 그리고 nvcc -V가 안되는거라면 cuda-toolkit 만 따로 설치했더니 된다.

 

cuda library만 설치하고 싶을때 sudo apt-get install cuda-libraries-10-0

 

6. cmake file 들은 rm -rf로 지워야 지워짐.

7. atlas랑 protobuf-compiler 따로 설치해줘야하는듯

sudo apt-get install protobuf-compiler

sudo apt-get install libatlas-base-dev

 

8. 리눅스 계정간 공유폴더 만들기. 그룹을 만들자.

www.tecmint.com/create-a-shared-directory-in-linux/

 

How to Create a Shared Directory for All Users in Linux

As a system administrator, you may have a certain directory that you want to give read/write access to every user on a Linux server. In this guide, we will review how to enable write access to all users on a particular directory (shared directory) in Linux

www.tecmint.com

9. cylee 설치 에러

tensorflow -> 흠...

opendr -> 흠...

  x86_64-linux-gnu-gcc: error: contexts/ctx_mesa.c: No such file or directory
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for opendr

 

10. pillow  error

pip install --target=/usr/lib/python2.7/site-packages/ --upgrade pillow

github.com/Zulko/moviepy/issues/748

 

ImportError: Imageio Pillow requires Pillow, not PIL! · Issue #748 · Zulko/moviepy

hi, I'm falling into this error, Traceback (most recent call last): File "./script.py", line 255, in add_watermark watermark = (ImageClip("./watermark.png") File "/usr/...

github.com

 

deep-learning 발달 전 imitation learning using state-only demonstrations papers
1. Movement imitation with nonlinear dynamical systems in humanoid robots.

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.79.7189&rep=rep1&type=pdf
2. Humanoid robot learning and game playing using pc-based vision.

https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.438.323&rep=rep1&type=pdf



**visual observations can only provide partial state information**
**In imitation learning, agents do not receive task reward feedback r.**

Behavior cloning does not require any further interaction between the agent and the environment - covariate shift problem
IRL-based techniques iteratively alternate between using the demo to infer a hidden reward function and using RL.
- object manipulation: Guided cost learning: Deep inverse optimal control via policy optimization.

https://arxiv.org/abs/1603.00448
GAIL: induce an imitator state-action occupancy measure that is similar to that of the demonstrator.

Imitation learning from observation
===

## perception
1. Record the expert's movements using sensors placed directly on the expert agent
- Trajectory formation for imitation with nonlinear dynamical systems.

https://ieeexplore.ieee.org/document/976259
arm-reaching movements, biped locomotion, and human gestures
- Incremental learning of gestures by imitation in a humanoid robot.

https://ieeexplore.ieee.org/document/6251697

2. Motion capture: use visual markers on the demo to infer movement.
- Motion capture in robotics review.

https://ro.uow.edu.au/cgi/viewcontent.cgi?referer=https://www.google.com/&httpsredir=1&article=1645&context=engpapers
locomotion, acrobatics, martial arts
- require costly instrumentation and pre-processing:

A deep learning framework for character motion synthesis and editing. ★

http://www.ipab.inf.ed.ac.uk/cgvu/motionsynthesis.pdf

### Embodiment Mismatch

1. learns correspondence between the embodiments using autoencoders in a supervised fashion

(encoded representation은 embodiment features에 invariant하다)

- Learning invariant features spaces to transfer skills with reinforcement learning ★

https://arxiv.org/abs/1703.02949

2. unsupervised fashion & human supervision 조금

- Time-contrastive networks: self-supervised learning from video.

https://arxiv.org/abs/1704.06888

 

### Viewpoint difference

1. context translation model to translate an observation by predicting it in the target context.

- Imitation from observation: Learning to imitate behaviors from raw video via context translation.

https://arxiv.org/abs/1707.03374

2. classifier to distinguish viewpoints and maximize the domain confusion in the adversarial setting during the training

- Third-person imitation learning.

https://arxiv.org/abs/1703.01703

 

## Control

### Model-based algorithms

#### Inverse dynamics models

- Grounded action transformation for robot learning in simulation.

https://www.cs.utexas.edu/~pstone/Papers/bib2html/b2hd-AAAI17-Hanna.html

1. Explore and collect data (s, a, s') and learn the pixel-level inverse dynamics model (o, o') -> a

- Combining self-supervised learning and imitation for vision-based rope manipulation.

https://arxiv.org/abs/1703.02018

2. reinforced inverse dynamics modeling (uses sparse reward function to optimize the model)

- Ridm: reinforced inverse dynamics modeling for learning from a single observed demonstration

https://arxiv.org/abs/1906.07372

** each observation transition is reachable through the application of a single action. **

- Zero-shot visual imitation: execute multiple actions until it gets close enough to the next demonstrated frame.

https://arxiv.org/abs/1804.08606

- Behavior cloning from observation: learn generalized imitation policies using multiple demo.

https://arxiv.org/abs/1805.01954

- Hybrid reinforcement learning with expert state sequences. 

https://arxiv.org/abs/1903.04110

(visual demo랑 reward info 다 접근가능하다는 전제를 한다. minimize a linear combination of behavior cloning loss and RL loss)

 

#### Forward dynamics model

- imitating latent policies from observation.

https://arxiv.org/abs/1805.07914

--> 먼저, 현재 state가 주어졌을 때 latent(unreal) action z의 probability를 측정해주는 latent policy를 배운다. 실제 action이 행해지지 않기 때문에 offline에서 학습가능하다. latent policy를 배울 때 latent forward dynamics model을 이용하는데 이건 그 다음 state와 prior over z given s를 예상해준다. 그 다음 env interaction하면서 action-remapping network을 배운다.

 

### Model-free algorithms

#### Adversarial methods

- Learning human behaviors from motion capture by adversarial imitation. ★

https://arxiv.org/abs/1707.02201

 

 

#### reward-engineering methods

- Internal model from observations for reward shaping.

https://arxiv.org/abs/1806.01267

 

 

+ Recent posts