![](https://img-blog.csdnimg.cn/20200219170624111.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
tensorflow
tensorflow相关知识
JohnManLi
分享,学习
展开
-
错误 InternalError: Dst tensor is not initialized
错误:InternalError: Dst tensor is not initialized. 分析:出现这个错误一般是GPU内存耗尽,挂在后台进程中的IPython内核会这样做 解决办法:运行程序之前,先运行export CUDA_VISIBLE_DEVICES=1,仅显卡设备1GPU可见,tensorflow 算是一个比较贪心的工具了就算用device_id指定gpu 也会占用别的GPU的显存资源 必须在执行程序前执行 export CUDA_VISIBLE_DEVICES=n(n为可见的..原创 2020-08-17 14:51:45 · 514 阅读 · 0 评论 -
使用tf.ConfigProto()配置Session运行参数&&GPU设备指定
tf.ConfigProto()函数用在创建session的时候,用来对session进行参数配置: config = tf.ConfigProto(allow_soft_placement=True, allow_soft_placement=True) config.gpu_options.per_process_gpu_memory_fraction = 0.4 #占用40%显存 sess = tf.Session(config=config) 一动态申请内存 config = tf.Con.原创 2020-06-10 14:02:21 · 286 阅读 · 0 评论