Theano和Tensorflow多GPU使用问题
2017-09-25 17:46
519 查看
我使用的是tensorflow-gpu (1.2.1)和Theano (0.9.0),2个4G显存Nvidia Quadro M2000 GPU。
1. theano: ValueError: Could not infer context from inputs
THEANO_FLAGS="contexts=dev0->cuda0;dev1->cuda1,gpuarray.preallocate=0.95,mode=FAST_RUN,floatX=float32,on_unused_input=warn" python config.py
ERROR (theano.gof.opt): SeqOptimizer apply <theano.gpuarray.opt.GraphToGPU object at 0xdfe69210>
ERROR: SeqOptimizer apply <theano.gpuarray.opt.GraphToGPU object at 0xdfe69210>
ERROR (theano.gof.opt): Traceback:
ERROR: Traceback:
ERROR (theano.gof.opt): Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/theano/gof/opt.py", line 235, in apply
sub_prof = optimizer.optimize(fgraph)
File "/usr/lib/python2.7/site-packages/theano/gof/opt.py", line 87, in optimize
ret = self.apply(fgraph, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/theano/gpuarray/opt.py", line 322, in apply
target = infer_context_name(*fgraph.inputs)
File "/usr/lib/python2.7/site-packages/theano/gpuarray/basic_ops.py", line 122, in infer_context_name
raise ValueError("Could not infer context from inputs")
ValueError: Could not infer context from inputs
theano不能自动支持多GPU,需要自己指定一个,只能在一个上面跑, 需要指定一个设备device=cuda0。
支持多GPU, 需要自己编程,参考http://deeplearning.net/software/theano/tutorial/using_multi_gpu.html#
2. tensorflow: ResourceExhaustedError: OOM when allocating tensor with
theano: MemoryError: Error allocating 1440000000 bytes of device memory (out of memory).
说明GPU内存不够,要调小输入或网络单元。
3. theano切换成新的GPU backend
WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be removed in the next release (v0.10)
theano 0.9.0从cuda backend切换gpuarray backend,需要安装python2-Cython-0.25+和libgpuarray-0.6.3+, 然后通过gpuarray.preallocate来指定。
1. theano: ValueError: Could not infer context from inputs
THEANO_FLAGS="contexts=dev0->cuda0;dev1->cuda1,gpuarray.preallocate=0.95,mode=FAST_RUN,floatX=float32,on_unused_input=warn" python config.py
ERROR (theano.gof.opt): SeqOptimizer apply <theano.gpuarray.opt.GraphToGPU object at 0xdfe69210>
ERROR: SeqOptimizer apply <theano.gpuarray.opt.GraphToGPU object at 0xdfe69210>
ERROR (theano.gof.opt): Traceback:
ERROR: Traceback:
ERROR (theano.gof.opt): Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/theano/gof/opt.py", line 235, in apply
sub_prof = optimizer.optimize(fgraph)
File "/usr/lib/python2.7/site-packages/theano/gof/opt.py", line 87, in optimize
ret = self.apply(fgraph, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/theano/gpuarray/opt.py", line 322, in apply
target = infer_context_name(*fgraph.inputs)
File "/usr/lib/python2.7/site-packages/theano/gpuarray/basic_ops.py", line 122, in infer_context_name
raise ValueError("Could not infer context from inputs")
ValueError: Could not infer context from inputs
theano不能自动支持多GPU,需要自己指定一个,只能在一个上面跑, 需要指定一个设备device=cuda0。
支持多GPU, 需要自己编程,参考http://deeplearning.net/software/theano/tutorial/using_multi_gpu.html#
2. tensorflow: ResourceExhaustedError: OOM when allocating tensor with
theano: MemoryError: Error allocating 1440000000 bytes of device memory (out of memory).
说明GPU内存不够,要调小输入或网络单元。
3. theano切换成新的GPU backend
WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be removed in the next release (v0.10)
theano 0.9.0从cuda backend切换gpuarray backend,需要安装python2-Cython-0.25+和libgpuarray-0.6.3+, 然后通过gpuarray.preallocate来指定。
相关文章推荐
- tensorflow使用GPU训练时的显存占用问题
- 测试theano是提示使用CPU而不是gpu问题
- tensorflow使用GPU训练时的显存占用问题
- tensorflow使用GPU训练时的显存占用问题
- TensorFlow使用GPU训练网络时多块显卡的显存使用问题
- 【Ubuntu-Tensorflow】InvalidArgumentError GPU不能使用的问题
- tensorflow GPU使用问题
- Windows 7(10) 下安装 tensorflow,theano,keras并使用GPU加速。
- tensorflow使用GPU训练时的显存占用问题
- 配置ubuntu16.04下Theano使用GPU运行程序的环境
- 解决linux的screen中gpu无法在theano中正常启用的问题
- tensorflow gpu使用说明
- Ubuntu16.04lts使用Anaconda安装tensorflow并配置GPU
- Tensorflow初次使用遇到scipy版本问题
- Keras 切换后端(python2 还没有TensorFlow,需要使用theano)
- 配置ubuntu16.04下Theano使用GPU运行程序的环境
- 解决Tensorflow源码安装的之后TensorBoard 无法使用的问题
- Theano、Lasagne、TensorFlow在Ubuntu14.04 64支持GPU的安装 py27
- tensorflow基本使用中出现的问题及解决方案
- 在ubuntu14.10上安装theano并且使用GPU加速