PRBonn / Mask4D

Mask4D: End-to-End Mask-Based 4D Panoptic Segmentation for LiDAR Sequences, RA-L, 2023
MIT License
50 stars 3 forks source link

About pytorch_lightning version #4

Closed Xiangxu-0103 closed 1 month ago

Xiangxu-0103 commented 4 months ago

Hi, thanks for your open source. When I train Mask4D with pytorch_lightning==2.0.8, it will raise errors as follows:

TypeError: __init__() got an unexpected keyword argument 'gpus'

and

TypeError: __init__() got an unexpected keyword argument 'resume_from_checkpoint'

Looking forward to hearing back from you.

weweng1999 commented 4 months ago

yeah pytorch_lighting version 2.0.8 does not support these arguments. I got around it by doing: ` trainer = Trainer( accelerator="gpu", # This specifies that GPUs should be used devices=1, strategy="ddp", # Distributed Data Parallel strategy

gpus=cfg.TRAIN.N_GPUS,

    # accelerator="ddp",
    logger=tb_logger,
    max_epochs=cfg.TRAIN.MAX_EPOCH,
    callbacks=callbacks,
    log_every_n_steps=1,
    gradient_clip_val=0.5,
    accumulate_grad_batches=cfg.TRAIN.BATCH_ACC,
    # resume_from_checkpoint=ckpt,
)

trainer.fit(model, data,ckpt_path = ckpt)

`

rmarcuzzi commented 1 month ago

Hi! sorry about the delay and the confusion, I checked again and I was using an earlier version of pytorch_lightning: 1.5.9. I know in the newer version of pytorch_lightning some things changed and some arguments do not work anymore. However, you can find an easy workaround with the new keyworkds. resume_from_checkpoint is now called ckpt_path and you can specify accelerator='gpu' and devices=1.