File tree Expand file tree Collapse file tree 6 files changed +367
-0
lines changed Expand file tree Collapse file tree 6 files changed +367
-0
lines changed Original file line number Diff line number Diff line change 5
5
import tensorflow as tf
6
6
import os
7
7
8
+ if tf .__version__ .startswith ('2' ):
9
+ exit ("Please install Tensorflow 1.x" )
10
+
8
11
9
12
def set_global_seeds (i ):
10
13
tf .set_random_seed (i )
Original file line number Diff line number Diff line change 11
11
import argparse
12
12
import logging
13
13
14
+ gym_minor_version = int (gym .__version__ .split ('.' )[1 ])
15
+ if gym_minor_version >= 19 :
16
+ exit ("Please install OpenAI Gym 0.19.0 or earlier" )
17
+
14
18
os .environ ['TF_CPP_MIN_LOG_LEVEL' ] = '2' # Mute missing instructions errors
15
19
16
20
MODEL_PATH = 'models'
Original file line number Diff line number Diff line change 5
5
import matplotlib .pyplot as plt
6
6
from datetime import datetime
7
7
8
+ gym_minor_version = int (gym .__version__ .split ('.' )[1 ])
9
+ if gym_minor_version >= 19 :
10
+ exit ("Please install OpenAI Gym 0.19.0 or earlier" )
11
+
12
+ if tf .__version__ .startswith ('2' ):
13
+ exit ("Please install Tensorflow 1.x" )
14
+
8
15
9
16
### avoid crashing on Mac
10
17
# doesn't seem to work
Original file line number Diff line number Diff line change 10
10
import gym
11
11
import sys
12
12
13
+ gym_minor_version = int (gym .__version__ .split ('.' )[1 ])
14
+ if gym_minor_version >= 19 :
15
+ exit ("Please install OpenAI Gym 0.19.0 or earlier" )
16
+
17
+
13
18
14
19
# environment
15
20
ENV_NAME = 'HalfCheetah-v2'
Original file line number Diff line number Diff line change 3
3
import numpy as np
4
4
import matplotlib .pyplot as plt
5
5
6
+ gym_minor_version = int (gym .__version__ .split ('.' )[1 ])
7
+ if gym_minor_version >= 19 :
8
+ exit ("Please install OpenAI Gym 0.19.0 or earlier" )
9
+
10
+
6
11
7
12
def get_action (s , w ):
8
13
return 1 if s .dot (w ) > 0 else 0
You can’t perform that action at this time.
0 commit comments