But the model here is a dictionary since it contains state_dict . The model here is not an instance of the class.