Ensure 1 thread is available (for testing purposes)
This commit is contained in:
parent
dcf6ebe273
commit
555cc42630
@ -40,7 +40,7 @@ class BaseReinforcementLearningModel(IFreqaiModel):
|
|||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super().__init__(config=kwargs['config'])
|
super().__init__(config=kwargs['config'])
|
||||||
self.max_threads = min(self.freqai_info['rl_config'].get(
|
self.max_threads = min(self.freqai_info['rl_config'].get(
|
||||||
'cpu_count', 0), int(self.max_system_threads / 2))
|
'cpu_count', 1), max(int(self.max_system_threads / 2), 1))
|
||||||
th.set_num_threads(self.max_threads)
|
th.set_num_threads(self.max_threads)
|
||||||
self.reward_params = self.freqai_info['rl_config']['model_reward_parameters']
|
self.reward_params = self.freqai_info['rl_config']['model_reward_parameters']
|
||||||
self.train_env: Union[SubprocVecEnv, gym.Env] = None
|
self.train_env: Union[SubprocVecEnv, gym.Env] = None
|
||||||
|
Loading…
Reference in New Issue
Block a user