Skip to content

image_batch.cuda().repeat(1,3,1,1) #3

Description

@Susu0812
for epoch_num in iterator:
    for i_batch, sampled_batch in enumerate(trainloader):
        image_batch, label_batch = sampled_batch['image'], sampled_batch['label']
        image_batch, label_batch = image_batch.cuda().repeat(1,3,1,1), label_batch.cuda()
        outputs = model(image_batch)

你好,我想了解一下其中image_batch.cuda().repeat(1,3,1,1),将输入图像通道C调整为3的意义在哪,是单纯的为了适应resnet的firstconv输入通道数吗?因为我了解大多数的做法是直接C为1输入到模型。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions