gym-http-api icon indicating copy to clipboard operation
gym-http-api copied to clipboard

get_action_space_info not complete

Open JoostvDoorn opened this issue 9 years ago • 6 comments

The function get_action_space_info does not return the action space when the action space contains a Tuple. It will just return {'name': 'Tuple'}. Tested on Copy-v0.

JoostvDoorn avatar Aug 29 '16 10:08 JoostvDoorn

Could you provide a minimal test case code sample to help with debugging and testing?

korymath avatar Sep 19 '16 20:09 korymath

Sure here you go:

import logging
import os, sys
import numpy as np

from gym_http_client import Client

remote_base = 'http://127.0.0.1:5000'
client = Client(remote_base)

env_id = 'Copy-v0'
instance_id = client.env_create(env_id)
print(client.env_action_space_info(instance_id))

JoostvDoorn avatar Sep 20 '16 08:09 JoostvDoorn

To elaborate on this _get_space_properties does not seem to be fully implemented to support all properties, see: https://github.com/openai/gym-http-api/blob/master/gym_http_server.py#L92

JoostvDoorn avatar Sep 20 '16 08:09 JoostvDoorn

indeed... if we can specify how to serialize a Tuple to json then i can add that case in the server code...

kashif avatar Sep 20 '16 09:09 kashif

Potentially addressed with recent commit: https://github.com/openai/gym-http-api/commit/1b42f25f6fe992cd08f5aeb3cb4151936bc5ea15

Does this get at exactly what you need? If so, then it is a matter of implementing something similar in the info call as what is in the sample call.

korymath avatar Oct 12 '16 17:10 korymath

The problem is with the environment - Copy-v0. It has three actions with a couple of sub actions within them, unlike CartPole-v0.

markroxor avatar Sep 03 '18 06:09 markroxor