0

我正在尝试在 tensorflow 上训练 VGG 风格的 CNN,我的输入大小是: 2 批大小 * 1080 高 * 1920 宽 * 5 通道,我的网络结构是:

  1. 转化率 3*3*64
  2. 转化率 3*3*128
  3. 最大池化 3*3 步幅 3
  4. 转化率 3*3*256
  5. 和一个具有 1*1*256*2 输出的 COnv

在 CPU 版本上一切正常,但在使用 GPU 时出现错误:

ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[2,128,1080,1920]
 [[Node: Feature_Map/Conv2 = Conv2D[T=DT_FLOAT, data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/gpu:0"](Feature_Map/Act1, Feature_Map/Variable_2/read)]]

好像卡在第二层了。我的 GPU 是Spyder(Windows)上的GTX1060(6G)。我添加了以下命令以允许使用 GPU 内存增长:

config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.Session(config=config, ...)

有人可以帮我弄这个吗?非常感谢

4

0 回答 0