salesforce / CoST

PyTorch code for CoST: Contrastive Learning of Disentangled Seasonal-Trend Representations for Time Series Forecasting (ICLR 2022)
BSD 3-Clause "New" or "Revised" License
215 stars 43 forks source link

SystemExit: 2 #14

Closed humamalkaabi closed 1 year ago

humamalkaabi commented 2 years ago

Hello I used Macbook pro 2017 ( 2.9 GHz Quad-Core Intel Core i7 and Intel HD Graphics 630 1536 MB) and Spydar. When I input the arguments in ( train.py) : if name == 'main': parser = argparse.ArgumentParser() parser.add_argument('electricity', help='The dataset name') parser.add_argument('forecast_univar', help='The folder name used to save model, output and evaluation metrics. This can be set to any word') parser.add_argument('--forecast_csv_univar', type=str, required=True, help='The archive name that the dataset belongs to. This can be set to forecast_csv, or forecast_csv_univar') parser.add_argument('--gpu', type=int, default=0, help='The gpu no. used for training and inference (defaults to 0)') parser.add_argument('--batch-size', type=int, default=8, help='The batch size (defaults to 8)') parser.add_argument('--lr', type=float, default=0.001, help='The learning rate (defaults to 0.001)') parser.add_argument('--repr-dims', type=int, default=320, help='The representation dimension (defaults to 320)') parser.add_argument('--max-train-length', type=int, default=3000, help='For sequence with a length greater than , it would be cropped into some sequences, each of which has a length less than (defaults to 3000)') parser.add_argument('--iters', type=int, default=None, help='The number of iterations') parser.add_argument('--epochs', type=int, default=None, help='The number of epochs') parser.add_argument('--save-every', type=int, default=None, help='Save the checkpoint every iterations/epochs') parser.add_argument('--seed', type=int, default=None, help='The random seed') parser.add_argument('--max-threads', type=int, default=None, help='The maximum allowed number of threads used by this process') parser.add_argument('--eval', action="store_true", help='Whether to perform evaluation after training')

parser.add_argument('--kernels', type=int, nargs='+', default=[1, 2, 4, 8, 16, 32, 64, 128], help='The kernel sizes used in the mixture of AR expert layers')
parser.add_argument('--alpha', type=float, default=0.0005, help='Weighting hyperparameter for loss function')

args = parser.parse_args()

I have this problem: runfile('/Users/humamalkaabi/Documents/Applications/Tasks/CoST/train.py', wdir='/Users/humamalkaabi/Documents/Applications/Tasks/CoST') Reloaded modules: models, models.dilated_conv, models.encoder, utils usage: train.py [-h] --forecast_csv_univar FORECAST_CSV_UNIVAR [--gpu GPU] [--batch-size BATCH_SIZE] [--lr LR] [--repr-dims REPR_DIMS] [--max-train-length MAX_TRAIN_LENGTH] [--iters ITERS] [--epochs EPOCHS] [--save-every SAVE_EVERY] [--seed SEED] [--max-threads MAX_THREADS] [--eval] [--kernels KERNELS [KERNELS ...]] [--alpha ALPHA] electricity forecast_univar train.py: error: the following arguments are required: electricity, forecast_univar, --forecast_csv_univar An exception has occurred, use %tb to see the full traceback.

SystemExit: 2

I would like to ask your help to solve the error. I’ll really appreciate that and be grateful. My Respects and thanks.

gorold commented 2 years ago

Hi, thanks for the interest in our work. As far as I can tell, you need to supply the required arguments when running the train.py file. You can check the README on how to supply these values, or alternatively, run one of the scripts in the scripts folder.