Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'test_loop' #21

Open
AhsanBilal7 opened this issue Sep 24, 2023 · 2 comments
Open

KeyError: 'test_loop' #21

AhsanBilal7 opened this issue Sep 24, 2023 · 2 comments

Comments

@AhsanBilal7
Copy link

I am getting the error during testing the pretrained model
LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
Traceback (most recent call last):
File "D:\FYP\GaitGraph2\GaitGraph\gaitgraph_casia_b.py", line 317, in
cli_main()
File "D:\FYP\GaitGraph2\GaitGraph\gaitgraph_casia_b.py", line 307, in cli_main
LightningCLI(
File "C:\Users\Pc\miniconda3\envs\hrnet\lib\site-packages\pytorch_lightning\cli.py", line 353, in init
self._run_subcommand(self.subcommand)
File "C:\Users\Pc\miniconda3\envs\hrnet\lib\site-packages\pytorch_lightning\cli.py", line 642, in _run_subcommand
fn(**fn_kwargs)
File "C:\Users\Pc\miniconda3\envs\hrnet\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 737, in test
return call._call_and_handle_interrupt(
File "C:\Users\Pc\miniconda3\envs\hrnet\lib\site-packages\pytorch_lightning\trainer\call.py", line 42, in _call_and_handle_interrupt
return trainer_fn(*args, **kwargs)
File "C:\Users\Pc\miniconda3\envs\hrnet\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 780, in _test_impl
results = self._run(model, ckpt_path=ckpt_path)
File "C:\Users\Pc\miniconda3\envs\hrnet\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 966, in _run
self._checkpoint_connector.restore_training_state()
File "C:\Users\Pc\miniconda3\envs\hrnet\lib\site-packages\pytorch_lightning\trainer\connectors\checkpoint_connector.py", line 292, in restore_training_state
self.restore_loops()
File "C:\Users\Pc\miniconda3\envs\hrnet\lib\site-packages\pytorch_lightning\trainer\connectors\checkpoint_connector.py", line 336, in restore_loops
self.trainer.test_loop.load_state_dict(state_dict["test_loop"])
KeyError: 'test_loop'

@weishiguan
Copy link

Is the landlord's problem solved, I also encountered a similar problem, I hope to get help, thank you very much!!

@AhsanBilal7
Copy link
Author

I have implemented my data loading pipeline with simple pytorch instead of pytorch lightning.
But I guess this error is due to the configuration passed to load the pretrained weights

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants