You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got this error while training a model, error look like this, please help to fix this issue
TypeError Traceback (most recent call last) in ()
1 trained_sac = agent.train_model(model=model_sac,
2 tb_log_name='sac',
----> 3 total_timesteps=60000)
8 frames /usr/local/lib/python3.7/dist-packages/finrl/finrl_meta/env_stock_trading/env_stocktrading.py in _do_buy()
156 # if self.state[index + 1] >0:
157 # Buy only if the price is > 0 (no missing data in this particular date)
--> 158 available_amount = self.state[0] / (self.state[index + 1]*(1 + self.buy_cost_pct[index])) # when buying stocks, we should consider the cost of trading when calculating available_amount, or we may be have cash<0
159 # print('available_amount:{}'.format(available_amount))
160
TypeError: 'float' object is not subscriptable
The text was updated successfully, but these errors were encountered:
I got this error while training a model, error look like this, please help to fix this issue
TypeError Traceback (most recent call last)
in ()
1 trained_sac = agent.train_model(model=model_sac,
2 tb_log_name='sac',
----> 3 total_timesteps=60000)
8 frames
/usr/local/lib/python3.7/dist-packages/finrl/finrl_meta/env_stock_trading/env_stocktrading.py in _do_buy()
156 # if self.state[index + 1] >0:
157 # Buy only if the price is > 0 (no missing data in this particular date)
--> 158 available_amount = self.state[0] / (self.state[index + 1]*(1 + self.buy_cost_pct[index])) # when buying stocks, we should consider the cost of trading when calculating available_amount, or we may be have cash<0
159 # print('available_amount:{}'.format(available_amount))
160
TypeError: 'float' object is not subscriptable
The text was updated successfully, but these errors were encountered: