我以eval()模式提取特性,以关闭批处理规范和退出层,并使用ImageNet提供的运行方式和std。我使用一个特征提取器从两个相关的图像中提取特征,并在经过线性稠密分类器模型训练之前,将这两个张量按层连在一起。我想知道我是否可以避免使用with torch.no_grad(),因为这两个模型是不相关的。= DenseNetConv()
# set densenet to eval to switch off batch norm and dropout layers and use ImageNetr