It depends on your use case and where an error is raised.
E.g. if the model’s forward pass raises an error about a missing channel dimension, you would need to unsqueeze the input before feeding it to the model:
output = model(input)
# error about a missing channel dimension

# fix
input = input.unsqueeze(0)
output = model(input)