Model.eval error

question:
i installed a module with pip which works on a specific dataset.
when I want to work with a different dataset, it gives the error :: :Expected more than 1 value per channel when training, got input size torch.Size([1, 15])

I understand that I can set the model to eval mode and run as the batch norm is creating the issue;
how do I set the pytorch model to eval mode when the module downloaded gives the error:
‘module’ object has no attribute ‘eval’

I downloaded the Contextualized Topic model package which works on a 20000 doc dataset.
when I try this with a custom dataset, I get a 'Expected more than 1 value per channel when training, got input size torch.Size([1, 15]) error;

from contextualized_topic_models.models.ctm import CombinedTM
ctm = CombinedTM(input_size=len(qt.vocab), bert_input_size=768, n_components=15, num_epochs=15)
how do I set this to eval mode, so that batch norm doesn’t create an issue?

Most likely the CombinedTM wraps the actual model internally and is not a plain instance of nn.Module. I would recommend to check the source code of this model in the repository you’ve downloaded it from and search for the actual model, which would provide the .eval() method.