Thanks for your great work, but I have a trouble when I run 'train_act.py'
Here is the error message:
Traceback (most recent call last): File "train_act.py", line 53, in <module> trainer.fit(model=model, train_dataloaders=train_loader, val_dataloaders=val_loader) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 520, in fit call._call_and_handle_interrupt( File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py", line 44, in _call_and_handle_interrupt return trainer_fn(*args, **kwargs) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 559, in _fit_impl self._run(model, ckpt_path=ckpt_path) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 935, in _run results = self._run_stage() File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 976, in _run_stage self._run_sanity_check() File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1005, in _run_sanity_check val_loop.run() File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/loops/utilities.py", line 177, in _decorator return loop_run(self, *args, **kwargs) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 115, in run self._evaluation_step(batch, batch_idx, dataloader_idx) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 375, in _evaluation_step output = call._call_strategy_hook(trainer, hook_name, *step_kwargs.values()) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py", line 288, in _call_strategy_hook output = fn(*args, **kwargs) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/strategies/strategy.py", line 378, in validation_step return self.model.validation_step(*args, **kwargs) File "/home/kwang/ght/trafficgen/trafficgen/act/model/tg_act.py", line 109, in validation_step self.log("valid/loss", loss_dict) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/core/module.py", line 403, in log apply_to_collection( File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/lightning_utilities/core/apply_func.py", line 51, in apply_to_collection return function(data, *args, **kwargs) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/core/module.py", line 608, in __check_allowed raise ValueError(f"self.log({name}, {value})was called, but{type(v).name}values cannot be logged") ValueError:self.log(valid/loss, {'cls_loss': tensor(1.8856), 'velo_loss': tensor(27.2877), 'heading_loss': tensor(0.9837), 'fde': tensor(818.2145), 'pos_loss': tensor(135.2629)})was called, butdictvalues cannot be logged
It seems that there is an error of self.log in tg_act.py. Is it my error or the original code error? Could you help me?
Thanks for your great work, but I have a trouble when I run 'train_act.py' Here is the error message:
Traceback (most recent call last): File "train_act.py", line 53, in <module> trainer.fit(model=model, train_dataloaders=train_loader, val_dataloaders=val_loader) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 520, in fit call._call_and_handle_interrupt( File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py", line 44, in _call_and_handle_interrupt return trainer_fn(*args, **kwargs) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 559, in _fit_impl self._run(model, ckpt_path=ckpt_path) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 935, in _run results = self._run_stage() File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 976, in _run_stage self._run_sanity_check() File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1005, in _run_sanity_check val_loop.run() File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/loops/utilities.py", line 177, in _decorator return loop_run(self, *args, **kwargs) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 115, in run self._evaluation_step(batch, batch_idx, dataloader_idx) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 375, in _evaluation_step output = call._call_strategy_hook(trainer, hook_name, *step_kwargs.values()) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py", line 288, in _call_strategy_hook output = fn(*args, **kwargs) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/strategies/strategy.py", line 378, in validation_step return self.model.validation_step(*args, **kwargs) File "/home/kwang/ght/trafficgen/trafficgen/act/model/tg_act.py", line 109, in validation_step self.log("valid/loss", loss_dict) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/core/module.py", line 403, in log apply_to_collection( File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/lightning_utilities/core/apply_func.py", line 51, in apply_to_collection return function(data, *args, **kwargs) File "/home/kwang/miniconda3/envs/HaitaoGao/lib/python3.8/site-packages/pytorch_lightning/core/module.py", line 608, in __check_allowed raise ValueError(f"
self.log({name}, {value})was called, but
{type(v).name}values cannot be logged") ValueError:
self.log(valid/loss, {'cls_loss': tensor(1.8856), 'velo_loss': tensor(27.2877), 'heading_loss': tensor(0.9837), 'fde': tensor(818.2145), 'pos_loss': tensor(135.2629)})was called, but
dictvalues cannot be logged
It seems that there is an error of self.log in tg_act.py. Is it my error or the original code error? Could you help me?