Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Python TypeError – 'Class' object is not callable (Google Collab Example Inside)

[Redacted]

In this example, in my final cell of code, I try to call my model. This is following the tutorial on a Youtube video.

In this step, the video is able to perform the lines

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

model = UCC_Classifier(config)

then in the next cell

loss, output = model(input_ids.unsqueeze(dim=0), am.unsqueeze(dim=0), labels.unsqueeze(dim=0))

To successfully get a result. However when I try and do the same thing, I get told my class is not callable. I cannot see any difference and am unsure why this might not be callable.

Thanks

>Solution :

Your UCC_Classifier model should be a pl.LightningModule, not a pl.LightningDataModule.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading