Issue during test stage when load_from_checkpoint

hi guys! I’ve already accomplished training stage like this:
model = PL_Model(cfg)
trainer = Trainer(…)
trainer.fit(model)
now I need to test some data on the trained model, so I add
def test_step() and def test_end()
into the class PL_Model(), and test like this:
model = PL_Model(cfg).load_from_checkpoint(PATH)
trainer = Trainer(…)
trainer.test(model)
the error is:
File “…/lib/python3.6/site-packages/torch/nn/modules/module.py”, line 585, in getattr
type(self).name, name))
AttributeError: ‘PL_Model’ object has no attribute ‘load_from_checkpoint’
how can i fix it?

mind reproduce it with https://colab.research.google.com/drive/1HvWVVTK8j2Nj52qU4Q4YCyzOm0_aLQF3?usp=sharing??

thanks for your reply!!
but are there any solutions to test separately with an existed .ckpt file without AttributeError above?

the above error seems strange and should not occur since load_from_checkpoint is a classmethod in LightningModule. So I’m not sure why it’s not working for you. That’s why I requested a minimal reproducable code to check the issue.