Based on the error message it seems you are passing multiple values to size_average or reduction in the creation of the criterion. Could you check its initialization and make sure these arguments get valid values?