TradeMaster-NTU / TradeMaster

TradeMaster is an open-source platform for quantitative trading empowered by reinforcement learning :fire: :zap: :rainbow:
Apache License 2.0
1.4k stars 288 forks source link

Install verify error #203

Closed lzmax888 closed 6 months ago

lzmax888 commented 6 months ago

Windows11

PS C:\Users\Lenovo\TradeMaster> python tools/algorithmic_trading/train.py Config (path: C:\Users\Lenovo\TradeMaster\configs\algorithmic_trading\algorithmic_trading_FX_deepscalper_deepscalper_adam_mse.py): {'data': {'type': 'AlgorithmicTradingDataset', 'data_path': 'data/algorithmic_trading/FX', 'train_path': 'data/algorithmic_trading/FX/train.csv', 'valid_path': 'data/algorithmic_trading/FX/valid.csv', 'test_path': 'data/algorithmic_trading/FX/test.csv', 'test_dynamic_path': 'data/algorithmic_trading/FX/Market_Dynamics_Model/YUAN/test_labeled_slice_and_merge_model_3dynamics_minlength12_quantile_labeling.csv', 'tech_indicator_list': ['high', 'low', 'open', 'close', 'adjcp', 'zopen', 'zhigh', 'zlow', 'zadjcp', 'zclose', 'zd_5', 'zd_10', 'zd_15', 'zd_20', 'zd_25', 'zd_30'], 'backward_num_day': 5, 'forward_num_day': 5, 'test_dynamic': '-1'}, 'environment': {'type': 'AlgorithmicTradingEnvironment'}, 'agent': {'type': 'AlgorithmicTradingDQN', 'max_step': 12345, 'reward_scale': 1, 'repeat_times': 1, 'gamma': 0.9, 'batch_size': 64, 'clip_grad_norm': 3.0, 'soft_update_tau': 0, 'state_value_tau': 0.005}, 'trainer': {'type': 'AlgorithmicTradingTrainer', 'epochs': 20, 'work_dir': 'work_dir/algorithmic_trading_FX_deepscalper_deepscalper_adam_mse', 'seeds_list': (12345,), 'batch_size': 64, 'horizon_len': 128, 'buffer_size': 1000000.0, 'num_threads': 8, 'if_remove': False, 'if_discrete': True, 'if_off_policy': True, 'if_keep_save': True, 'if_over_write': False, 'if_save_buffer': False}, 'loss': {'type': 'MSELoss'}, 'optimizer': {'type': 'Adam', 'lr': 0.001}, 'act': {'type': 'QNet', 'state_dim': 82, 'action_dim': 3, 'dims': (64, 32), 'explore_rate': 0.25}, 'cri': None, 'transition': {'type': 'Transition'}, 'task_name': 'algorithmic_trading', 'dataset_name': 'FX', 'optimizer_name': 'adam', 'loss_name': 'mse', 'net_name': 'deepscalper', 'agent_name': 'deepscalper', 'work_dir': 'work_dir/algorithmic_trading_FX_deepscalper_deepscalper_adam_mse', 'batch_size': 64} Traceback (most recent call last): File "C:\Users\Lenovo\TradeMaster\tools\algorithmic_trading\train.py", line 144, in main() File "C:\Users\Lenovo\TradeMaster\tools\algorithmic_trading\train.py", line 110, in main cfg.dump(osp.join(ROOT, cfg.work_dir, osp.basename(args.config))) File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python39\lib\site-packages\mmcv\utils\config.py", line 596, in dump f.write(self.pretty_text) File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python39\lib\site-packages\mmcv\utils\config.py", line 508, in prettytext text, = FormatCode(text, style_config=yapf_style, verify=True) TypeError: FormatCode() got an unexpected keyword argument 'verify'

PS C:\Users\Lenovo\TradeMaster> pip install mmcv==1.7.1 Requirement already satisfied: mmcv==1.7.1 in c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages (1.7.1) Requirement already satisfied: opencv-python>=3 in c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages (from mmcv==1.7.1) (4.9.0.80) Requirement already satisfied: addict in c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages (from mmcv==1.7.1) (2.4.0) Requirement already satisfied: pyyaml in c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages (from mmcv==1.7.1) (6.0.1) Requirement already satisfied: Pillow in c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages (from mmcv==1.7.1) (10.0.0) Requirement already satisfied: yapf in c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages (from mmcv==1.7.1) (0.40.2) Requirement already satisfied: packaging in c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages (from mmcv==1.7.1) (24.0) Requirement already satisfied: numpy in c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages (from mmcv==1.7.1) (1.24.4) Requirement already satisfied: regex in c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages (from mmcv==1.7.1) (2024.4.16) Requirement already satisfied: importlib-metadata>=6.6.0 in c:\users\lenovo\appdata\roaming\python\python39\site-packages (from yapf->mmcv==1.7.1) (6.8.0) Requirement already satisfied: platformdirs>=3.5.1 in c:\users\lenovo\appdata\roaming\python\python39\site-packages (from yapf->mmcv==1.7.1) (3.10.0) Requirement already satisfied: tomli>=2.0.1 in c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages (from yapf->mmcv==1.7.1) (2.0.1) Requirement already satisfied: zipp>=0.5 in c:\users\lenovo\appdata\roaming\python\python39\site-packages (from importlib-metadata>=6.6.0->yapf->mmcv==1.7.1) (3.16.2)

lzmax888 commented 6 months ago

I found the solution: pip install yapf==0.40.1