llSourcell / Q-Learning-for-Trading

327 stars 177 forks source link

Error during executing run.py file #6

Open asghar3166 opened 5 years ago

asghar3166 commented 5 years ago

I am getting the following exception:

None Traceback (most recent call last): File "run.py", line 56, in next_state, reward, done, info = env.step(action) File "C:\Users\asgha\Anaconda3\envs\tensorflow\lib\site-packages\gym\core.py", line 96, in step return self._step(action) File "C:\Users\asgha\OneDrive\Documents\AI\ML\Forex_trading\Q-Learning-for-Trading-master\envs.py", line 68, in _step self._trade(action) File "C:\Users\asgha\OneDrive\Documents\AI\ML\Forex_trading\Q-Learning-for-Trading-master\envs.py", line 91, in _trade action_vec = action_combo[action] TypeError: 'map' object is not subscriptable

prcs commented 5 years ago

Me too. already installed GYM version 0.12.4 also.

prcs commented 5 years ago

@asghar3166 , try to remove map. Like: action_combo = list(itertools.product([0, 1, 2], repeat=self.n_stock))