Repository: openai/gym

Issue:
ImportError when installing on Windows 10  and [33mWARN: gym.spaces.Box autodetected dtype as <class 'numpy.float32'>
Dears,
Would you please let me know how I could solve this warning and this error? (Windows 10)

Using TensorFlow backend.
[33mWARN: gym.spaces.Box autodetected dtype as <class 'numpy.float32'>. Please provide explicit dtype.[0m

 File "C:\Users\fi\Desktop\rl\code\3.6\stock_market_reinforcement_learning-master\environment.py", line 43, in __init__
    self.reset()
  File "C:\Users\fi\Anaconda30\envs\tensorflow\lib\site-packages\gym\core.py", line 70, in reset
    raise NotImplementedError
NotImplementedErrorr



Discussion:
i have encountered some problems!!
Modify core.py as follows.

https://github.com/openai/gym/blob/c13490db86a4abf63ba4f9f2d5c6c365c0fc980a/gym/core.py
kekmodel : Thanks but I replaced my core.py with this core.py but the warning remains!

I replaced _step  _reset   _render   _close   _seed with  step  reset   render  close   seed

though I did not understand how to do the following:
And set the following attributes:
        action_space: The Space object corresponding to valid actions
        observation_space: The Space object corresponding to valid observations
        reward_range: A tuple corresponding to the min and max possible rewards
    Note: a default reward range set to [-inf,+inf] already exists. Set it if you want a narrower range.
    The methods are accessed publicly as "step", "reset", etc.. The
    non-underscored versions are wrapper methods to which we may add
    functionality over time.
Having the same warning after migrating to gym v0.10. It is caused by the new argument `dtype` defined in the `Box(...)`, and can be solved by given the appropriate `dtype` when initiating Box object. For example:
```
spaces.Box(low=-1., high=1. shape=(10,), dtype=np.float32)
```


i just set dtype=np.float32 and it works
@w121211 Do you have to modify the `gym` package or how you are calling it? Nowhere in my code am I actually calling `spaces.Box` so I'm confused as to how to get ridd of the error
path of file = gym/spaces/box.py
 in this file , i used below __init__ function, in stead of original one.
def __init__(self, low=None, high=None, shape=None, dtype=np.float32):
This seems like a warning that's intended internally (the warning is generated by gym itself). Would be nice if this kinda of stuff didn't show itself to the user.
You can hide this warning by  executing `gym.logger.set_level(40)`. This will set minimal level of logger message to be printed to 40. Correspondingly, only **error** level messages will be displayed. You will need to include this statement every time you import `gym`.

Resolving patch:
diff --git a/gym/envs/mujoco/mujoco_env.py b/gym/envs/mujoco/mujoco_env.py
--- a/gym/envs/mujoco/mujoco_env.py
+++ b/gym/envs/mujoco/mujoco_env.py
@@ -46,7 +46,7 @@ def __init__(self, model_path, frame_skip):
         bounds = self.model.actuator_ctrlrange.copy()
         low = bounds[:, 0]
         high = bounds[:, 1]
-        self.action_space = spaces.Box(low=low, high=high)
+        self.action_space = spaces.Box(low=low, high=high, dtype=np.float32)
 
         high = np.inf*np.ones(self.obs_dim)
         low = -high


Test patch: