美文网首页
RuntimeError: Expected object of

RuntimeError: Expected object of

作者: JeremyL | 来源:发表于2020-04-20 17:49 被阅读0次
    train_dataset  = torch.utils.data.TensorDataset(train, label)
    
    batch_size = 5
    train_loader = torch.utils.data.DataLoader(dataset=train_dataset,
                                               batch_size=batch_size,
                                               shuffle=True)
    
    for batch_idx, (data, target) in enumerate(train_loader):
            data, target = Variable(data), Variable(target)
    
    

    添加:

    data = data.float()
    

    相关文章

      网友评论

          本文标题:RuntimeError: Expected object of

          本文链接:https://www.haomeiwen.com/subject/vnqjihtx.html