All steps are based on:
- crr0004's Local Training
- joezen777's revised OSX Specific Steps
Credit goes to them for doing all of the hard work!
- In a terminal window, redirect to ~/ if need be
- If Homebrew isn't installed:
- /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- brew install minio/stable/minio
- Install VNCViewer
- Install Docker
- Run Docker. In Docker's Preferences, under the Advanced tab, you may need to up the resources.
- git clone --recurse-submodules https://github.com/crr0004/deepracer.git
- In Finder, navigate to your cloned repo. It should be at ~/deepracer
- Navigate to folder rl_coach
- Using any code or text editor, open env.sh
- On lines 3 and 4, replace minio and miniokey with your AWS access key and password
- On line 12, replace "$(hostname -i)" with your actual IP address (ie: 192.168.1.xxx)
- On line 14, replace "readlink" with "greadlink" and save the file
- cd deepracer/rl_coach
- brew install coreutils
- . ./env.sh
- minio server data
- In a web browser, navigate to your Minio server (http://127.0.0.1:9000) and login using "minio" and "miniokey"
- Create a bucket called "bucket"
- In Finder, navigate to ~/deepracer/rl_coach/data. There should now be a bucket folder. Within the bucket folder, create a new folder called "custom_files". Place your reward.py file in /custom_files. This should automatically upload to your Minio bucket.
- From Terminal, open a new shell (command+T)
- cd .. to return to ~/deepracer
- python3 -m venv sagemaker_venv
- . sagemaker_venv/bin/activate
- pip install PyYAML==3.11
- pip install urllib3==1.21.1
- pip install -U sagemaker-python-sdk/ awscli ipython pandas
- docker pull crr0004/sagemaker-rl-tensorflow:console
- docker tag crr0004/sagemaker-rl-tensorflow:console 520713654638.dkr.ecr.us-east-1.amazonaws.com/sagemaker-rl-tensorflow:coach0.11-cpu-py3
- mkdir -p ~/.sagemaker && cp config.yaml ~/.sagemaker
- cd rl_coach
- export LOCAL_ENV_VAR_JSON_PATH=$(greadlink -f ./env_vars.json)
- mkdir ~/robo
- mkdir ~/robo/container
- In ~/deepracer/rl_coach, open rl_deepracer_coach_robomaker.py in an editor.
- Make sure that your endpoint_url (line 27) is the url to your minio server (ie: 192.168.1.xxx:9000)
- For CPU training, make sure instance_type (line 92) is "local" and image_name (line 108) is "crr0004/sagemaker-rl-tensorflow:console"
- Save the file
- ipython rl_deepracer_coach_robomaker.py
- From Terminal, open a new shell (command+T)
- cd .. to return to ~/deepracer
- . sagemaker_venv/bin/activate
- cd rl_coach
- . ./env.sh
- docker pull crr0004/deepracer_robomaker:console
- cd ..
- In ~/deepracer, open robomaker.env in an editor.
- Again, make sure that your S3_ENDPOINT_URL is the url to your minio server (ie: 192.168.1.xxx:9000)
- Save the file
- docker run --rm --name dr --env-file ./robomaker.env --network sagemaker-local -p 8080:5900 -it crr0004/deepracer_robomaker:console
- Open VNC Viewer
- Connect to 127.0.0.1:8080
- Hope everything worked out and training starts after everything is loaded.
- You should have three Terminal windows open during training
- Minio Server
- Training Episodes/Policy Training logs
- Step logs
- The terminal with the step logs will repeat a message until the policy training is complete.
- These steps are for CPU training. CPU training will slow down during the policy training. Each policy training session after a training iteration will get progressively slower.
- After setting up, you can follow these steps to train a new model.
- Please let me know if something needs revising, I've missed a step, or something isn't clear!