I think the parameter check is performed after you’ve flattened the parameters already, so while it would return True, I guess flattening the parameters in the first place creates the shape mismatch error. Check the shape of each parameter and make sure the linear layer weights are 2 dimensional.