【TensorFlow】InternalError: Failed copying input tensor

发布时间:2022-07-01 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了【TensorFlow】InternalError: Failed copying input tensor脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

TensorFlow-GPU执行模型训练时报错:

InternalError: Failed copying input tensor from /job:localhost/replica:0/task:0/device:CPU:0 to /job:localhost/replica:0/task:0/device:GPU:0 in order to run _EagerConst: Dst tensor is not initialized.

解决方法:

【TensorFlow: Dst tensor is not initialized - Stack Overflow】

https://stackoverflow.com/questions/37313818/tensorflow-dst-tensor-is-not-initialized

主要原因在于batch_size太大,内存无法负载,将batch_size适当调小即可正常运行。

  • 默认情况下,TF会尽可能地多分配占用GPU内存,通过调整GPUConfig可以设置为按需分配内存,参考此文档和此代码。

脚本宝典总结

以上是脚本宝典为你收集整理的【TensorFlow】InternalError: Failed copying input tensor全部内容,希望文章能够帮你解决【TensorFlow】InternalError: Failed copying input tensor所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: