uni2ts icon indicating copy to clipboard operation
uni2ts copied to clipboard

Error while finetuning with custom dataset

Open jpmc216 opened this issue 1 year ago • 3 comments

Describe the bug Error while finetuning with custom dataset

To Reproduce Please provide a code snippet of a minimal reproducible example for the error.


python -m uni2ts.data.builder.simple texas TexasTurbineYearly.csv --offset 8640

python -m cli.finetune run_name=my_lsf_run model=moirai_1.0_R_small data=texas val_data=texas

Placed the below yaml in this folder( uni2ts/cli/conf/finetune/val_data)

_target_: uni2ts.data.builder.ConcatDatasetBuilder
_args_:
  _target_: uni2ts.data.builder.simple.generate_eval_builders
  dataset: texas_eval
  offset: 8640  # Same as _lsf_dataset.py
  eval_length: 2880  # Same as _lsf_dataset.py
  prediction_lengths: [96, 192, 336, 720]
  context_lengths: [1000, 2000, 3000, 4000, 5000]
  patch_sizes: [32, 64]

Expected behavior Followed the instructions here to fine-tune on custom dataset. https://github.com/SalesforceAIResearch/uni2ts?tab=readme-ov-file#fine-tuning

Error message or code output ine 238, in load_dataset transform=transform_map[self.dataset]( TypeError: MoiraiFinetune.train_transform_map..default_train_transform() got an unexpected keyword argument 'offset'

put error or undesired output here

Environment

  • Operating system: MacOS
  • Python version: 3.10
  • PyTorch version: 2.3.3
  • uni2ts version (have you pulled the latest version?) latest

jpmc216 avatar Aug 06 '24 00:08 jpmc216

what about the yaml file in uni2ts/cli/conf/finetune/data?

gorold avatar Aug 06 '24 04:08 gorold

Same as the yaml placed under this folder( uni2ts/cli/conf/finetune/val_data)

_target_: uni2ts.data.builder.ConcatDatasetBuilder
_args_:
  _target_: uni2ts.data.builder.simple.generate_eval_builders
  dataset: ETTh2_eval
  offset: 8640  # Same as _lsf_dataset.py
  eval_length: 2880  # Same as _lsf_dataset.py
  prediction_lengths: [96, 192, 336, 720]
  context_lengths: [1000, 2000, 3000, 4000, 5000]
  patch_sizes: [32, 64]

jpmc216 avatar Aug 06 '24 11:08 jpmc216

Hi @jpmc216, in the current version, the config format of finetuning data and validation data is different. For the fine-tuning data, you can follow this example https://github.com/SalesforceAIResearch/uni2ts/blob/main/cli/conf/finetune/data/etth1.yaml . You can find that it does not have offset attribute, which raise the error

chenghaoliu89 avatar Dec 04 '24 09:12 chenghaoliu89