json problem in pycharm
If I directly run the last line of code in the.sh file in the pycharm terminal.Such as python ./scripts/run_benchmark.py --config-path "rolling_forecast_config.json" --data-name-list "ETTh1.csv" --strategy-args '{"horizon": 720}' --model-name "time_series_library.DLinear" --model-hyper-params '{"batch_size": 64, "d_ff": 2048, "d_model": 512, "factor": 3, "horizon": 720, "norm": true, "period_len": 24, "seq_len": 336, "station_lr": 0.0001}' --adapter "transformer_adapter" --gpus 0 --num-workers 1 --timeout 60000 --save-path "ETTh1/DLinear"
Traceback (most recent call last): File "./scripts/run_benchmark.py", line 81, in build_model_config hyper_params = json.loads(model_hyper_params) File "E:\anaconda3\envs\pytorch\lib\json_init_.py", line 357, in loads return _default_decoder.decode(s) File "E:\anaconda3\envs\pytorch\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "E:\anaconda3\envs\pytorch\lib\json\decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "./scripts/run_benchmark.py", line 343, in
Then I made modifications to it based on your recommendation.Change the input code to python ./scripts/run_benchmark.py --config-path "rolling_forecast_config.json" --data-name-list "ETTh1.csv" --strategy-args "{"horizon": 720}" --model-name "time_series_library.DLinear" --model-hyper-params "{"batch_size": 64, "d_ff": 2048, "d_model": 512, "factor": 3, "horizon": 720, "norm": true, "period_len": 24, "seq_len": 336, "station_lr": 0.0001}" --adapter "transformer_adapter" --gpus 0 --num-workers 1 --timeout 60000 --save-path "ETTh1/DLinear"
usage: run_benchmark.py [-h] --config-path CONFIG_PATH [--data-name-list DATA_NAME_LIST [DATA_NAME_LIST ...]] [--data-set-name DATA_SET_NAME [DATA_SET_NAME ...]] [--adapter ADAPTER [ADAPTER ...]] --model-name MODEL_NAME [MODEL_NAME ...] [--model-hyper-params MODEL_HYPER_PARAMS [MODEL_HYPER_PARAMS ...]] [--metrics METRICS [METRICS ...]] [--strategy-args STRATEGY_ARGS] [--seed SEED] [--deterministic {full,efficient,none}] [--eval-backend {sequential,ray}] [--num-cpus NUM_CPUS] [--gpus GPUS [GPUS ...]] [--num-workers NUM_WORKERS] [--timeout TIMEOUT] [--max-tasks-per-child MAX_TASKS_PER_CHILD] [--aggregate_type AGGREGATE_TYPE] [--report-method {dash,csv}] [--save-path SAVE_PATH] [--save-true-pred SAVE_TRUE_PRED] run_benchmark.py: error: unrecognized arguments: horizon: 720}
SO, I used the same way as before and directly ran run_beachmark.py by setting default
I modified it to default=['{"batch_size": 64, "d_ff": 2048, "d_model": 512, "factor": 3, "horizon": 720, "norm": true, "period_len": 24, "seq_len": 336, "station_lr": 0.0001}'], and parser.add_argument( "--gpus", type=int, nargs="+", default=[0], help="List of gpu devices to use, only available in ray backends", )
BUT I GET A NEW QUESTION:
2025-05-14 20:05:00 [INFO] ts_benchmark.data.data_source(124): Start loading 8 series in parallel
Traceback (most recent call last):
File "C:\Users\jahau\Desktop\channel_model\TFB-master\scripts\run_benchmark.py", line 360, in
When searching for the Etth1.csv file, it turned out to be done by individual characters
I debugged and the 'args' were correct. I don't know how it happened Namespace(adapter=['t', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'e', 'r', '_', 'a', 'd', 'a', 'p', 't', 'e', 'r', None, None, None, None, None, None, None, None], aggregate_type='mean', config_path='rolling_forecast_config.json', data_name_list='ETTh1.csv', data_set_name=None, deterministic='efficient', eval_backend='sequential', gpus=[0], max_tasks_per_child=100, metrics=None, model_hyper_params=['{"batch_size": 64, "d_ff": 2048, "d_model": 512, "factor": 3, "horizon": 720, "norm": true, "period_len": 24, "seq_len": 336, "station_lr": 0.0001}', None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None], model_name='time_series_library.DLinear', num_cpus=12, num_workers=1, report_method='csv', save_path='ETTh1/DLinear', save_true_pred=None, seed=None, strategy_args='{"horizon": 720}', timeout=60000)
Thank you for your attention and question. My apologies for the delayed response.
May I ask if you're using Windows or Mac? You can check the 'How to use PyCharm to run code' section in the README's FAQ.
I use in windows,could you enrich 'How to use PyCharm to run code' section?
Perhaps you can learn more about the differences between different terminals on the internet yourself.
You can try "git bash".
If there are no other questions, I will end this issue. If you have any questions, please feel free to open a new issue for communication!