And*_*ndt 10 c++ python memory-management tensorflow tensorflow-gpu
DenseNets倾向于占用TensorFlow中的大量内存,因为每个concat操作都存储在单独的分配中.最近的一篇文章"DenseNets的内存高效实现"表明,通过共享分配可以大大降低内存利用率.来自paper + pytorch实现的图像说明了共享内存方法:
如何使用TensorFlow实现这一点?如果无法通过python完成,如何在支持CPU和GPU的Op中正确实现?
我已经为必要的分配功能创建了TensorFlow功能请求.
现在可以在以下位置获得内存高效的实现:
https://github.com/joeyearsley/efficient_densenet_tensorflow
上面链接中的相关函数是:
# Gradient checkpoint the layer
_x = tf.contrib.layers.recompute_grad(_x)
Run Code Online (Sandbox Code Playgroud)