Skip to content

Instantly share code, notes, and snippets.

@ikeyasu
ikeyasu / pfrl_train_rainbow_mario.py
Created January 17, 2021 13:51
pfrl_train_rainbow_mario.py
import argparse
import json
import os
import gym
import numpy as np
import torch
import pfrl
from pfrl import agents, experiments, explorers
#!/usr/bin/env python
# coding:utf-8
"""
RS30X.py
Copyright (c) 2017 Shota Hirama <brast351-github@yahoo.co.jp>
Copyright (c) 2017 Daisuke Sato <tiryoh@gmail.com>
Copyright (c) 2019 Yasuki Ikeuchi <ikeyasu@gmail.com>
@ikeyasu
ikeyasu / deepracer-trial.md
Created July 1, 2019 00:24
deepracer trial1

estimator.fitのあるセルを以下に置き換え。 training_chainer.pyをアップロード

以下、custom_image_nameは、https://gist.github.com/ikeyasu/71a4b07ce6ecc7465c4e984ac5f5c855 を参考に、chainerrl0.7.0のイメージを作成。

RLCOACH_PRESET = "deepracer"
instance_type = "ml.c4.2xlarge"
custom_image_name="398271760466.dkr.ecr.ap-northeast-1.amazonaws.com/sagemaker-rl-chainer:chainerrl0.7.0-cpu-py3"
@ikeyasu
ikeyasu / No_module_named_robot_bases.md
Created June 15, 2019 07:13
When you face error of `ModuleNotFoundError: No module named 'robot_bases'`

If you face a error of ModuleNotFoundError: No module named 'robot_bases' on pybullet 2.5.0, you should modify a source code of pybullet. This issue may be fixed on future release because the pybullet source code is updated on github.

If you are using anaconda, you need to modify /anaconda3/envs/XXXX/lib/python3.6/site-packages/pybullet_envs/robot_locomotors.py.

Please open robot_locomotors.py. You can see...

@ikeyasu
ikeyasu / README.md
Last active February 12, 2019 06:03
Build custom sagemaker-rl-chainerrl
  1. $ git clone https://github.com/ikeyasu/sagemaker-rl-container.git
  2. Create ECR repository named sagemaker-rl-chainerrl and copy your repository name like xxxx.dkr.ecr.ap-northeast-1.amazonaws.com/sagemaker-rl-chainer.
  3. $ cd sagemaker-rl-container
  4. $ docker build -t sagemaker-rl-chainer:chainerrl0.5.0-cpu-py3 -f chainerrl/docker/0.5.0/Dockerfile --build-arg processor=cpu .
  5. $ docker tag sagemaker-rl-chainer:chainerrl0.5.0-cpu-py3 xxxx.dkr.ecr.ap-northeast-1.amazonaws.com/sagemaker-rl-chainer:chainerrl0.5.0-cpu-py3
    • Please relace to your repository name
  6. $ docker push sagemaker-rl-chainer:chainerrl0.5.0-cpu-py3 xxxx.dkr.ecr.ap-northeast-1.amazonaws.com/sagemaker-rl-chainer:chainerrl0.5.0-cpu-py3

Note that you need to log-in to push ECR. Please refer to AWS document.

@ikeyasu
ikeyasu / README.md
Last active February 16, 2019 14:48
Amazon SageMaker Matsuri 20190212: ChainerRL x SageMaker
@ikeyasu
ikeyasu / demo_keyboard_humanoid2.py
Last active August 11, 2018 07:34
OpenAI robotschool の agent_zoo/demo_keyboard_humanoid2.py を修正し、self camera を作ってみた
import gym, roboschool, sys, os
import numpy as np
import pyglet, pyglet.window as pw, pyglet.window.key as pwk
from pyglet import gl
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
#
# This opens a third-party window (not test window), shows rendered chase camera, allows to control humanoid
# using keyboard (in a different way)
FROM erlang:20.2.2
LABEL maintainer "ikeyasu <ikeyasu@gmail.com>"
RUN echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen
RUN apt-get update && apt-get install -y unzip locales inotify-tools
RUN echo 'export LANG=en_US.UTF-8' >> ~/.bashrc
RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.5.0
RUN echo '\n. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc
COPY install_antikythera.sh /tmp/
RUN bash /tmp/install_antikythera.sh
#if defined(_WIN32) || defined(__WIN32__)
#include <Windows.h>
#endif
#include <fstream>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <vector>
#!/usr/bin/env python
from __future__ import print_function
import chainer
import chainer.functions as F
import chainer.links as L
from chainer import training
from chainer.training import extensions
import onnx_chainer