将稀疏的IndexedSlices转换为形状未知的密集张量

时间:2018-08-14 00:23:42

标签: python tensorflow

当我训练模型时出现此警告。由于我使用了自定义的tensorflow操作,因此培训无效,并且错误是:

2018-08-13 19:56:33.736226: E tensorflow/core/common_runtime/executor.cc:660] Executor failed to create kernel. Not found: No registered '_CopyFromGpuToHost' OpKernel for CPU devices compatible with node swap_out_training/SGD/gradients/pyramid_roi_align_1/CropResize_grad/CropResizeGradBoxes_2 = _CopyFromGpuToHost[T=DT_FLOAT, _class=["loc@traini...radBoxes_2"], _device="/job:localhost/replica:0/task:0/device:CPU:0"](pyramid_roi_align_1/strided_slice/_343)
    .  Registered:  device='GPU'

     [[Node: swap_out_training/SGD/gradients/pyramid_roi_align_1/CropResize_grad/CropResizeGradBoxes_2 = _CopyFromGpuToHost[T=DT_FLOAT, _class=["loc@traini...radBoxes_2"], _device="/job:localhost/replica:0/task:0/device:CPU:0"](pyramid_roi_align_1/strided_slice/_343)]]

我认为这是由我的损失函数中的tf.gather()和tf.gather_nd()引起的,因为对于另一个没有这两个函数的模型,它可以运行。

  

所以我的问题是,对吗?如果是这样,如何解决这个问题?

谢谢!

0 个答案:

没有答案