And,i met another wired problem .when i change the batch size , the bug is different .how could batch size influence the net,idk.here is my dataloader:
root= “./dataset/train_data/”
datatxt=“train_data1.txt”
class MyDataset(torch.utils.data.Dataset):
def init(self,root, datatxt, transform=None, target_transform=None):
super(MyDataset,self).init()
fh = open(root + datatxt, ‘r’)
    imgs = []
    rst  = []   
    character = []                   
    for line in fh:              
        line = line.rstrip() 
       
        words = line.split() 
        
        imgs.append(  (words[0]) )
        
        rst.append( (float(words[1]), float(words[2]) ))
        
        character.append((float(words[3]),float(words[4]),float(words[5]),float(words[6]),float(words[7]),float(words[8]),float(words[9]),float(words[10]),float(words[11]),float(words[12])))
                           
    self.imgs = imgs
    self.rst = rst
    self.character = character
    self.transform = transform
    self.target_transform = target_transform

def __getitem__(self, index):    
    fn = self.imgs[index] 
    rst = self.rst[index]
    character = self.character[index]
    img = Image.open(root+fn).convert('RGB') 

    if self.transform is not None:
        img = self.transform(img)
    return img, rst, character

def __len__(self): 
    return len(self.imgs)

train_data=MyDataset(root = root, datatxt=datatxt, transform=transforms.ToTensor())
train_dataloader = torch.utils.data.DataLoader(dataset=train_data, batch_size=4, shuffle=False)
transform ={
transforms.Compose([
transforms.CenterCrop((224,224)),
transforms.ToTensor(),
transforms.Normalize((0.485, 0.456, 0.406),
(0.229, 0.224, 0.225))
])
}