AI4Finance-Foundation / AI4Finance-Foundation/FinRL

papertrading_demo got error in training.

Ouverte
#1,365 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Jupyter Notebook
Étoiles
16.3k
Forks
3.5k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

**Describe the bug**
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[23], line 1
----> 1 train(start_date = '2025-03-03',
2 end_date = '2025-03-07',
3 ticker_list = ticker_list,
4 data_source = 'alpaca',
5 time_interval= '1Min',
6 technical_indicator_list= INDICATORS,
7 drl_lib='elegantrl',
8 env=env,
9 model_name='ppo',
10 if_vix=True,
11 API_KEY = API_KEY,
12 API_SECRET = API_SECRET,
13 API_BASE_URL = API_BASE_URL,
14 erl_params=ERL_PARAMS,
15 cwd='./papertrading_erl', #current_working_dir
16 break_step=1e5)

Cell In[8], line 63, in train(start_date, end_date, ticker_list, data_source, time_interval, technical_indicator_list, drl_lib, env, model_name, if_vix, **kwargs)
56 agent = DRLAgent_erl(
57 env=env,
58 price_array=price_array,
59 tech_array=tech_array,
60 turbulence_array=turbulence_array,
61 )
62 model = agent.get_model(model_name, model_kwargs=erl_params)
---> 63 trained_model = agent.train_model(
64 model=model, cwd=cwd, total_timesteps=break_step
65 )

Cell In[6], line 77, in DRLAgent.train_model(self, model, cwd, total_timesteps)
75 model.cwd = cwd
76 model.break_step = total_timesteps
---> 77 train_agent(model)

Cell In[5], line 310, in train_agent(args)
308 env = build_env(args.env_class, args.env_args)
309 agent = args.agent_class(args.net_dims, args.state_dim, args.action_dim, gpu_id=args.gpu_id, args=args)
--> 310 agent.states = env.reset()[np.newaxis, :]
312 evaluator = Evaluator(eval_env=build_env(args.env_class, args.env_args),
313 eval_per_step=args.eval_per_step,
314 eval_times=args.eval_times,
315 cwd=args.cwd)
316 torch.set_grad_enabled(False)

TypeError: tuple indices must be integers or slices, not tuple
**To Reproduce**
Steps to reproduce the behavior:
the python version 3.10
run the code, just change the start date 2025/03/03 and end date 2025/03/07
**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.