Jibril
Jibril

Reputation: 1037

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

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

Upvotes: 0

Views: 894

Answers (1)

erip
erip

Reputation: 16985

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

Upvotes: 2

Related Questions