thank you very much it’s works 
i convert (label variable1 and outputlabel) back from numpy to tensor in order to passing them through loss function but get error:
torch.Size([20, 16, 3, 224, 224])
Traceback (most recent call last):

  File "<ipython-input-15-740ff909cca9>", line 1, in <module>
    runfile('C:/Users/Windows10/Downloads/Hala3/main-run-vr.py', wdir='C:/Users/Windows10/Downloads/Hala3')

  File "C:\Users\Windows10\Anaconda3\envs\New\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
    execfile(filename, namespace)

  File "C:\Users\Windows10\Anaconda3\envs\New\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/Windows10/Downloads/Hala3/main-run-vr.py", line 549, in <module>
    __main__()

  File "C:/Users/Windows10/Downloads/Hala3/main-run-vr.py", line 547, in __main__
    evalInterval, evalMode, numWorkers, outDir,modelUsed,pretrained,train_test_split,datasetDir,crossValidation,nFolds)

  File "C:/Users/Windows10/Downloads/Hala3/main-run-vr.py", line 422, in main_run
    model,accuracy=modelTrain(modelUsed,pretrained,trainDataset,trainLabels,validationDataset,validationLabels,numEpochs,evalInterval,evalMode,outDir,numWorkers,lr, stepSize, decayRate, trainBatchSize, seqLen,True)

  File "C:/Users/Windows10/Downloads/Hala3/main-run-vr.py", line 304, in modelTrain
    loss = lossFn(outputLabel, labelVariable)

  File "C:\Users\Windows10\Anaconda3\envs\New\lib\site-packages\torch\nn\modules\module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)

  File "C:\Users\Windows10\Anaconda3\envs\New\lib\site-packages\torch\nn\modules\loss.py", line 942, in forward
    ignore_index=self.ignore_index, reduction=self.reduction)

  File "C:\Users\Windows10\Anaconda3\envs\New\lib\site-packages\torch\nn\functional.py", line 2056, in cross_entropy
    return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)

  File "C:\Users\Windows10\Anaconda3\envs\New\lib\site-packages\torch\nn\functional.py", line 1350, in log_softmax
    ret = input.log_softmax(dim)

IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)

    for epoch in range(numEpochs):
        optimScheduler.step()
        epochLoss = 0
        numCorrTrain = 0
        iterPerEpoch = 0
        model.train(True)
        print('Epoch = {}'.format(epoch + 1))
        writer.add_scalar('lr', optimizerFn.param_groups[0]['lr'], epoch+1)
        for i, (inputs, targets) in enumerate(trainLoader):
            iterPerEpoch += 1
            optimizerFn.zero_grad()
            if(torch.cuda.is_available()):
                inputVariable1 = Variable(inputs.permute(1, 0, 2, 3, 4).cuda()).cpu()                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                labelVariable = Variable(targets.cuda()).cpu()
            
            
            else:
                inputVariable1=Variable(inputs.permute(1,0,2,3,4))
                labelVariable=Variable(targets)
            #outputLabel = model(inputVariable1)
            features = model(inputVariable1)
            features = features.detach().cpu().numpy()
            labelVariable=(labelVariable.data).detach().cpu().numpy()
            svclassifier.fit(features, labelVariable)
            print(inputVariable1.shape)
            outputLabel= svclassifier.predict(features)
            labelVariable = torch.from_numpy(labelVariable)
            outputLabel = torch.from_numpy(outputLabel)
            loss = lossFn(outputLabel, labelVariable)
            loss.backward()
            optimizerFn.step()

How can i fix this please, and sorry for my lot questions