ElegantRL icon indicating copy to clipboard operation
ElegantRL copied to clipboard

AttributeError: 'Config' object has no attribute 'num_envs'

Open marcuswang6 opened this issue 8 months ago • 0 comments

~/anaconda3/envs/ai4finance/lib/python3.8/site-packages/elegantrl/agents/AgentSAC.py in init(self, net_dims, state_dim, action_dim, gpu_id, args) 15 self.act_class = getattr(self, 'act_class', ActorSAC) 16 self.cri_class = getattr(self, 'cri_class', CriticTwin) ---> 17 super().init(net_dims=net_dims, state_dim=state_dim, action_dim=action_dim, gpu_id=gpu_id, args=args) 18 self.cri_target = deepcopy(self.cri) 19

~/anaconda3/envs/ai4finance/lib/python3.8/site-packages/elegantrl/agents/AgentBase.py in init(self, net_dims, state_dim, action_dim, gpu_id, args) 21 def init(self, net_dims: [int], state_dim: int, action_dim: int, gpu_id: int = 0, args: Config = Config()): 22 self.gamma = args.gamma # discount factor of future rewards ---> 23 self.num_envs = args.num_envs # the number of sub envs in vectorized env. num_envs=1 in single env. 24 self.batch_size = args.batch_size # num of transitions sampled from replay buffer. 25 self.repeat_times = args.repeat_times # repeatedly update network using ReplayBuffer

AttributeError: 'Config' object has no attribute 'num_envs'

marcuswang6 avatar Feb 20 '25 03:02 marcuswang6