我想通过CPU上的内核分发我的自定义Keras模型的训练(我没有可用的CPU)。我的CPU是i7-7700,它有4个内核。然而,tensorflow仅检测到一个核心(编辑:添加了完整的控制台输出): >>> import tensorflow as tf
2020-12-14 15:41:04.517355: W tensorflowcudart_stub.cc:29] Ignore above cudart dlerror if y
我想知道设置创建/训练模型的设备以优化资源使用的正确方法是什么,以便使用Keras在TensorFlow中进行快速培训?我有1个CPU和2个GPU可供我使用。最初,我使用tf.device上下文来创建模型并仅在CPU上进行培训,但后来我在TensorFlow文档中看到了,它们建议在CPU上显式实例化模型:
# Instantiate the base model(or "template" model).
当我运行我的模型(用于图像分割的Unet)时,我有ram内存错误弹出:2020-11-19 11:25:46.109554: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 11998593024已分配内存图: