Unable to evaluate models
ShinyOrbThing opened this issue · 2 comments
ShinyOrbThing commented
I have trained an A2C model on some simulated stock data, following the same steps as are shown in this notebook.
On the line containing "obs = obs[np.newaxis, ...]"
I get the following error:
TypeError: tuple indices must be integers or slices, not tuple
env = gym.make('stocks-v0', df=df, frame_bound=(90,110), window_size=5)
obs = env.reset()
while True:
obs = obs[np.newaxis, ...]
action, _states = model.predict(obs)
obs, rewards, done, info = env.step(action)
if done:
print("info", info)
break
AminHP commented
This code is based on an older version of gym-anytrading. You can install gym-anytrading<2.0.0
, or change your code according to these examples.
ShinyOrbThing commented
Thanks @AminHP.