使用Niftynet的预训练模型时遇到问题

时间:2019-05-31 06:19:35

标签: deep-learning transfer-learning niftynet finetunning

我想使用niftynet上可用的density_vnet模型进行2类分割,该模型最初进行9类分割

我尝试通过根据以下建议在配置文件中进行更改来仅重新训练最后一层:HOw to fine tune niftynet pre trained model for custom data

vars_to_restore = ^((?!DenseVNet\/(skip_conv|fin_conv)).)*$

num_classes = 2

错误:

  

tensorflow.python.framework.errors_impl.InvalidArgumentError:分配   需要两个张量的形状匹配。 lhs shape = [2] rhs shape =   [9]            [[{{node save / Assign_8}} =分配[T = DT_FLOAT, class = [“ loc:@ DenseVNet / conv / conv / b”],use_locking = true,validate_shape = true,    device =“ / job:localhost / replica:0 / task:0 / device:CPU:0”](DenseVNet / conv / conv / b,   save / RestoreV2:8)]]

1 个答案:

答案 0 :(得分:0)

您似乎已还原了太多层,其中某些层仍被设计为可分类为9个类。检查体系结构,并排除旨在归类为9类的所有层的还原。