我正在自定义数据集上运行此代码(),但遇到了此错误。RuntimeError: one of the variables needed for gradient computation has been modified by an in place operation: [torch. cuda.FloatTensor [1, 512, 4, 4]] is at version 2; expected version 1 instead. Hint: the backtrace further above shows the operation that failed to compute
我正在尝试在其他神经网络中使用Unet model输出,问题是,我需要在没有尺寸的情况下获得真实的形状,您能告诉我如何做到这一点吗?unet_model.summary()显示了实际的形状,但是当我尝试获取输出张量时,它的形状是None unet_model = Unet(input_shape=(256,256,3),backbone_name(f_i) unet_model.layers[-1].output link to the screenshot with the output #