pytorch-forecasting icon indicating copy to clipboard operation
pytorch-forecasting copied to clipboard

Pytorch sample project not working

Open daniwxcode opened this issue 3 years ago • 3 comments

  • PyTorch-Forecasting version: latest
  • PyTorch version:
  • Python version:3.7
  • Operating System: Google Colab

Expected behavior

i'm trying to apply the sample tutorial code https://pytorch-forecasting.readthedocs.io/en/latest/tutorials/stallion.html I executed code bellow in order to Train model

Actual behavior

i got this error message init() got an unexpected keyword argument 'weights_summary'

Code to reproduce the problem

configure network and trainer

early_stop_callback = EarlyStopping(monitor="val_loss", min_delta=1e-4, patience=10, verbose=False, mode="min") lr_logger = LearningRateMonitor() # log the learning rate logger = TensorBoardLogger("lightning_logs") # logging results to a tensorboard

trainer = pl.Trainer( max_epochs=30, gpus=0, weights_summary="top", gradient_clip_val=0.1, limit_train_batches=30, # coment in for training, running valiation every 30 batches # fast_dev_run=True, # comment in to check that networkor dataset has no serious bugs callbacks=[lr_logger, early_stop_callback], logger=logger, )


Paste the command(s) you ran and the output. Including a link to a colab notebook will speed up issue resolution. If there was a crash, please include the traceback here. The code used to initialize the TimeSeriesDataSet and model should be also included.

daniwxcode avatar Jun 03 '22 10:06 daniwxcode

weights_summary argument seems depreciated https://pytorch-lightning.readthedocs.io/en/stable/common/trainer.html#weights-summary

Sinnaeve avatar Jun 10 '22 07:06 Sinnaeve

I’m running into the same error with 1.7.0. I’ve passed the enable_model_summary = False through the trainer.

      trainer = pl.Trainer(
          max_epochs=100,
          gpus=1,
          enable_model_summary = False,
          gradient_clip_val=0.01,
          callbacks=[lr_logger, early_stop_callback],
          logger=logger,
      )

But this still results in an init() got an unexpected keyword argument 'weights_summary' error. How do I go about fixing this?

BenjaminData avatar Aug 03 '22 07:08 BenjaminData

I had the same issue (init() got an unexpected keyword argument 'weights_summary' error), I had to downgrade pytorch lightning from 1.7 to 1.6.4 (then it worked)

Sinnaeve avatar Aug 04 '22 13:08 Sinnaeve

you can fix it by reinstalling pytorch-forecasting with pip instead of conda. The current version is v0.10.2 for conda-forge while it is v0.10.3 for pip.

luzhangao avatar Dec 20 '22 15:12 luzhangao