Code Monkey home page Code Monkey logo

Comments (4)

rayrui312 avatar rayrui312 commented on May 19, 2024 3

Thanks for reporting it. We are looking into it.

from finrl-meta.

ma7555 avatar ma7555 commented on May 19, 2024

setting TRAIN_END_DATE = '2021-09-30' also gives the below error

AttributeError                            Traceback (most recent call last)
<ipython-input-97-21c42d37b7d1> in <module>()
     11       erl_params=ERL_PARAMS,
     12       break_step=5e4,
---> 13       if_vix=False
     14       )

3 frames
<ipython-input-36-a440fe771f96> in train(start_date, end_date, ticker_list, data_source, time_interval, technical_indicator_list, drl_lib, env, model_name, if_vix, **kwargs)
     35         trained_model = agent.train_model(model=model, 
     36                                           cwd=current_working_dir,
---> 37                                           total_timesteps=break_step)
     38 
     39     elif drl_lib == 'rllib':

/FinRL-Meta/drl_agents/elegantrl_models.py in train_model(self, model, cwd, total_timesteps)
     79         model.cwd = cwd
     80         model.break_step = total_timesteps
---> 81         train_and_evaluate(args=model)
     82 
     83     @staticmethod

/usr/local/lib/python3.7/dist-packages/elegantrl/train/run_tutorial.py in train_and_evaluate(***failed resolving arguments***)
     91             traj_list = agent.explore_env(env, target_step)
     92             steps, r_exp = update_buffer(traj_list)
---> 93         logging_tuple = agent.update_net(buffer, batch_size, repeat_times, soft_update_tau)
     94         with torch.no_grad():
     95             if_reach_goal, if_save = evaluator.evaluate_and_save(agent.act, steps, r_exp, logging_tuple)

/usr/local/lib/python3.7/dist-packages/elegantrl/agents/AgentPPO.py in update_net(self, buffer, batch_size, repeat_times, soft_update_tau)
    196 
    197         a_std_log = getattr(self.act, 'a_std_log', torch.zeros(1)).mean()
--> 198         return obj_critic.item(), obj_actor.item(), a_std_log.item()  # logging_tuple
    199 
    200     def get_reward_sum_raw(self, buf_len, buf_reward, buf_mask, buf_value) -> (torch.Tensor, torch.Tensor):

AttributeError: 'NoneType' object has no attribute 'item'

from finrl-meta.

rayrui312 avatar rayrui312 commented on May 19, 2024

setting TRAIN_END_DATE = '2021-09-30' also gives the below error

AttributeError                            Traceback (most recent call last)
<ipython-input-97-21c42d37b7d1> in <module>()
     11       erl_params=ERL_PARAMS,
     12       break_step=5e4,
---> 13       if_vix=False
     14       )

3 frames
<ipython-input-36-a440fe771f96> in train(start_date, end_date, ticker_list, data_source, time_interval, technical_indicator_list, drl_lib, env, model_name, if_vix, **kwargs)
     35         trained_model = agent.train_model(model=model, 
     36                                           cwd=current_working_dir,
---> 37                                           total_timesteps=break_step)
     38 
     39     elif drl_lib == 'rllib':

/FinRL-Meta/drl_agents/elegantrl_models.py in train_model(self, model, cwd, total_timesteps)
     79         model.cwd = cwd
     80         model.break_step = total_timesteps
---> 81         train_and_evaluate(args=model)
     82 
     83     @staticmethod

/usr/local/lib/python3.7/dist-packages/elegantrl/train/run_tutorial.py in train_and_evaluate(***failed resolving arguments***)
     91             traj_list = agent.explore_env(env, target_step)
     92             steps, r_exp = update_buffer(traj_list)
---> 93         logging_tuple = agent.update_net(buffer, batch_size, repeat_times, soft_update_tau)
     94         with torch.no_grad():
     95             if_reach_goal, if_save = evaluator.evaluate_and_save(agent.act, steps, r_exp, logging_tuple)

/usr/local/lib/python3.7/dist-packages/elegantrl/agents/AgentPPO.py in update_net(self, buffer, batch_size, repeat_times, soft_update_tau)
    196 
    197         a_std_log = getattr(self.act, 'a_std_log', torch.zeros(1)).mean()
--> 198         return obj_critic.item(), obj_actor.item(), a_std_log.item()  # logging_tuple
    199 
    200     def get_reward_sum_raw(self, buf_len, buf_reward, buf_mask, buf_value) -> (torch.Tensor, torch.Tensor):

AttributeError: 'NoneType' object has no attribute 'item'

You may try to reset 'target_step' as a number larger than the episode steps. You can set target_step by setting ERL_PARAMS = {..., "target_step": x ,...} .

from finrl-meta.

ma7555 avatar ma7555 commented on May 19, 2024

@rayrui312 Yep you are right.
Regarding the original issue, i came across it too but it works on retrying. probably just an issue with requests

from finrl-meta.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.