Only Tensors created explicitly by the user (graph leaves) support the deepcopy protocol at the moment
how can i solve this problem, my net is DB,  data is coco text det
this is error log
File "/home/cattree/PycharmProjects/torch-ocr/BoatNumber/ocr_det/train/train.py", line 38, in <module>
    trainer.fit(model, data)
  File "/home/cattree/miniconda3/envs/Segmentation-torch/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 458, in fit
    self._run(model)
  File "/home/cattree/miniconda3/envs/Segmentation-torch/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 756, in _run
    self.dispatch()
  File "/home/cattree/miniconda3/envs/Segmentation-torch/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 797, in dispatch
    self.accelerator.start_training(self)
  File "/home/cattree/miniconda3/envs/Segmentation-torch/lib/python3.8/site-packages/pytorch_lightning/accelerators/accelerator.py", line 96, in start_training
    self.training_type_plugin.start_training(trainer)
  File "/home/cattree/miniconda3/envs/Segmentation-torch/lib/python3.8/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 144, in start_training
    self._results = trainer.run_stage()
  File "/home/cattree/miniconda3/envs/Segmentation-torch/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 807, in run_stage
    return self.run_train()
  File "/home/cattree/miniconda3/envs/Segmentation-torch/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 869, in run_train
    self.train_loop.run_training_epoch()
  File "/home/cattree/miniconda3/envs/Segmentation-torch/lib/python3.8/site-packages/pytorch_lightning/trainer/training_loop.py", line 535, in run_training_epoch
    monitor_metrics = deepcopy(self.trainer.logger_connector.callback_metrics)
  File "/home/cattree/miniconda3/envs/Segmentation-torch/lib/python3.8/copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "/home/cattree/miniconda3/envs/Segmentation-torch/lib/python3.8/copy.py", line 230, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/home/cattree/miniconda3/envs/Segmentation-torch/lib/python3.8/copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "/home/cattree/miniconda3/envs/Segmentation-torch/lib/python3.8/copy.py", line 230, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/home/cattree/miniconda3/envs/Segmentation-torch/lib/python3.8/copy.py", line 153, in deepcopy
    y = copier(memo)
  File "/home/cattree/miniconda3/envs/Segmentation-torch/lib/python3.8/site-packages/torch/tensor.py", line 55, in __deepcopy__
    raise RuntimeError("Only Tensors created explicitly by the user "
RuntimeError: Only Tensors created explicitly by the user (graph leaves) support the deepcopy protocol at the moment
What Lightning version are you using?
The fastest way for us to be able to help you is if you can adapt this script to reproduce the behaviour you are seeing.
Judging by the stacktrace, it's an error on our side.
You can try fixing it by calling .detach() on your logged tensors, but it'd be better if you can reproduce it and share the code