在gcloud ML Engine上使用OpenAI Gym Atari运行keras工作

时间:2018-04-08 15:05:11

标签: tensorflow keras google-cloud-ml openai-gym

我在云ML引擎上运行keras + TF + GymAI Atari工作时遇到了麻烦。特别是,在使用Atari环境时,您是否需要将数据腌制并将其放入存储桶中,或者在安装Gym时能否有效运行而无需将atari环境实际存储在存储桶中? 我一直很努力,找不到任何在ML引擎上运行的OpenAI环境的配置示例。我会很感激一些例子。为了说明当前的工作提交过程,我有以下内容:

export BUCKET_NAME=atari_game_bucket
export JOB_NAME="atari_game_train_$(date +%Y%m%d_%H%M%S)"
export JOB_DIR=gs://$BUCKET_NAME/$JOB_NAME
export REGION=us-east1

#submit job
gcloud ml-engine jobs submit training $JOB_NAME \
--job-dir $JOB_DIR \
--runtime-version 1.0 \
--module-name trainer.ac3d \
--package-path ./trainer \
--region $REGION \
-- 

# the local model
import os
import gym
import random
import numpy as np
import tensorflow as tf
from collections import deque
from skimage.color import rgb2gray
from skimage.transform import resize
from keras.models import Sequential
from keras.layers import Convolution2D, Flatten, Dense


ENV_NAME = 'Breakout-v0'  # Environment name
FRAME_WIDTH = 84  
FRAME_HEIGHT = 84  
NUM_EPISODES = 12000  
STATE_LENGTH = 4  
GAMMA = 0.99  
EXPLORATION_STEPS = 1000000
...   
SAVE_NETWORK_PATH = 'saved_networks/' + ENV_NAME
SAVE_SUMMARY_PATH = 'summary/' + ENV_NAME
NUM_EPISODES_AT_TEST = 30  
class Agent():
    def __init__(self, num_actions):

0 个答案:

没有答案