You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying the K-Fold cross-validation example from pl_examples.
When I run the example, there is an error
AttributeError: 'Trainer' object has no attribute 'strategy'
`Traceback (most recent call last):
File "test_kflod.py", line 281, in
trainer.fit(model, datamodule)
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 740, in fit
self._call_and_handle_interrupt(
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 685, in _call_and_handle_interrupt
return trainer_fn(*args, **kwargs)
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 777, in _fit_impl
self._run(model, ckpt_path=ckpt_path)
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1199, in _run
self._dispatch()
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1279, in _dispatch
self.training_type_plugin.start_training(self)
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 202, in start_training
self._results = trainer.run_stage()
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1289, in run_stage
return self._run_train()
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1319, in _run_train
self.fit_loop.run()
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/loops/base.py", line 146, in run
self.on_advance_end()
File "test_kflod.py", line 206, in on_advance_end
self.trainer.strategy.setup_optimizers(self.trainer)
AttributeError: 'Trainer' object has no attribute 'strategy'`
Expected behavior
Environment
PyTorch Lightning Version (e.g., 1.5.0): 1.5.8 (Conda)
PyTorch Version (e.g., 1.10): 1.10.0 (pip)
Python version (e.g., 3.9): 3.8.12
OS (e.g., Linux): WSL
CUDA/cuDNN version: -
GPU models and configuration: -
How you installed PyTorch (conda, pip, source): pip
If compiling from source, the output of torch.__config__.show():
Any other relevant information:
Additional context
The text was updated successfully, but these errors were encountered:
hey @KevinCrp !
the example there will work fine on master since Loops are currently experimental.
Check out the conversation here for more info and workaround: #11230 (comment)
🐛 Bug
I'm trying the K-Fold cross-validation example from pl_examples.
When I run the example, there is an error
AttributeError: 'Trainer' object has no attribute 'strategy'
`Traceback (most recent call last):
File "test_kflod.py", line 281, in
trainer.fit(model, datamodule)
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 740, in fit
self._call_and_handle_interrupt(
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 685, in _call_and_handle_interrupt
return trainer_fn(*args, **kwargs)
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 777, in _fit_impl
self._run(model, ckpt_path=ckpt_path)
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1199, in _run
self._dispatch()
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1279, in _dispatch
self.training_type_plugin.start_training(self)
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 202, in start_training
self._results = trainer.run_stage()
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1289, in run_stage
return self._run_train()
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1319, in _run_train
self.fit_loop.run()
File "/home/[USER]/[PATH]/lib/python3.8/site-packages/pytorch_lightning/loops/base.py", line 146, in run
self.on_advance_end()
File "test_kflod.py", line 206, in on_advance_end
self.trainer.strategy.setup_optimizers(self.trainer)
AttributeError: 'Trainer' object has no attribute 'strategy'`
Expected behavior
Environment
conda
,pip
, source): piptorch.__config__.show()
:Additional context
The text was updated successfully, but these errors were encountered: