rlbayes / rllabplusplus

Other
161 stars 42 forks source link

TypeError: expected string or bytes-like object #9

Open AliBuildsAI opened 6 years ago

AliBuildsAI commented 6 years ago

Hi. I installed the environment using rllab documentation, but when I run the following command python ./sandbox/rocky/tf/launchers/algo_gym_stub.py when I am in ~/rllabplusplus directory, I get the following error. I tried to run the code with different args but I get the same error. Can you please help? (Also, I tried to run some codes from rllab, and they work.)

~/rllabplusplus$ python ./sandbox/rocky/tf/launchers/algo_gym_stub.py 2018-05-28 18:47:52.766226 PDT | Warning: skipping Gym environment monitoring since snapshot_dir not configured. [2018-05-28 18:47:52,766] Making new env: <absl.flags._flag.Flag object at 0x7f04bec59ef0> Traceback (most recent call last): File "./sandbox/rocky/tf/launchers/algo_gym_stub.py", line 69, in tf.app.run() File "/opt/conda/envs/rllab3/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 126, in run _sys.exit(main(argv)) File "./sandbox/rocky/tf/launchers/algo_gym_stub.py", line 66, in main run_experiment(mode="local") File "./sandbox/rocky/tf/launchers/algo_gym_stub.py", line 52, in run_experiment algo, run_kwargs = set_experiment(kwargs) File "./sandbox/rocky/tf/launchers/algo_gym_stub.py", line 21, in setexperiment info, = get_env_info(flags) File "/datasets/home/06/806/amirzaei/rllabplusplus/sandbox/rocky/tf/launchers/launcher_utils.py", line 252, in get_env_info env = get_env(env_name=env_name, **kwargs) File "/datasets/home/06/806/amirzaei/rllabplusplus/sandbox/rocky/tf/launchers/launcher_utils.py", line 247, in get_env record_log=record_log), normalize_obs=normalize_obs)) File "/datasets/home/06/806/amirzaei/rllabplusplus/rllab/envs/gym_env.py", line 68, in init env = gym.envs.make(env_name) File "/opt/conda/envs/rllab3/lib/python3.5/site-packages/gym/envs/registration.py", line 161, in make return registry.make(id) File "/opt/conda/envs/rllab3/lib/python3.5/site-packages/gym/envs/registration.py", line 118, in make spec = self.spec(id) File "/opt/conda/envs/rllab3/lib/python3.5/site-packages/gym/envs/registration.py", line 132, in spec match = env_id_re.search(id) TypeError: expected string or bytes-like object

viniciusguigo commented 5 years ago

The way FLAGS are handled changed after Tensorflow 1.4. You are probably using a newer version.

Change:

flags = FLAGS.__flags  
flags = deepcopy(flags)

To:

flags = FLAGS.__flags
# VGG: fix error handling flags after Tensorflow 1.4
for name in flags.keys():
    flags[name] = flags[name].value
flags = deepcopy(flags)