我有一个 Estimator,它用一个特定的损失函数训练一个 CNN。训练完成后,我希望使用相同的 Estimator,使用已经训练的卷积层和新的损失函数训练一组新的全连接层。这些必须一个接一个地完成。
在尝试开始训练第二组全连接层时,我遇到以下错误:
NotFoundError (see above for traceback): Key OptimizeLoss/inception_module_1_path_1/batch_normalization/beta/Adam not found in checkpoint
[[Node: save/RestoreV2_22 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2_22/tensor_names, save/RestoreV2_22/shape_and_slices)]]
[[Node: save/RestoreV2_21/_1 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_280_save/RestoreV2_21", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]
似乎它需要已经设置了第二个损失函数,但我认为在 model_fn 运行时已经完成了。正在使用两个连续的 Estimator.train 方法调用来训练 Estimator。