gfrogat:

labels.squeeze()


thanks for the suggestions.  After I try   loss = criterion(outputs, labels.squeeze()) , I now get new runtime error as:
    RuntimeError: Assertion `cur_target >= 0 && cur_target < n_classes’ failed. at /Users/administrator/nightlies/pytorch-1.0.0/wheel_build_dirs/conda_3.7/conda/conda-bld/pytorch_1544144746443/work/aten/src/THNN/generic/ClassNLLCriterion.c:93

Is it still related to dimensions?