在训练CNN时抛出'std :: bad_alloc'实例后终止调用

时间:2018-03-20 14:16:26

标签: python tensorflow deep-learning gpu image-segmentation

terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped)

我正在训练3D密集的CNN。我有12GB GPU和128GB RAM。训练发生在GPU上,但交叉验证发生在RAM上,因为我在训练之间得到了上述错误(CV利用所有RAM)。我希望培训和CV都使用GPU资源。

该模型有大约3M参数,我使用的批量大小为1(用于培训和简历)。

我使用以下命令指定GPU -

os.environ[CUDA_VISIBLE_DEIVCES] = '0'

config = tf.ConfigProto()
config.gpu_options.allow_growth = True
config.allow_soft_placement = True

sess = tf.Session(config=config)

0 个答案:

没有答案