Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在抛出';std::bad#u alloc';训练CNN的时候_Python_Tensorflow_Deep Learning_Gpu_Image Segmentation - Fatal编程技术网

Python 在抛出';std::bad#u alloc';训练CNN的时候

Python 在抛出';std::bad#u alloc';训练CNN的时候,python,tensorflow,deep-learning,gpu,image-segmentation,Python,Tensorflow,Deep Learning,Gpu,Image Segmentation,我正在训练3d密集型CNN。我有12GB的GPU和128GB的RAM。训练发生在GPU上,但交叉验证发生在RAM上,因此我在训练之间得到了上述错误(CV使用所有RAM)。我希望培训和简历都能使用GPU资源 该模型的参数约为3M,我使用的批量大小为1(用于培训和简历) 我使用以下命令来指定GPU- terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core

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

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

我使用以下命令来指定GPU-

terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped)
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)