使用CPU进行predict过程的问题
Created by: noName10
用GPU进行了finetune过程的模型想用CPU进行推理是否还需要指定CUDA_VISIBLE_DEVICES,若不指定,将use_cuda设定为False后报错为:
Traceback (most recent call last):
File "predict_classifier.py", line 153, in <module>
main(args)
File "predict_classifier.py", line 104, in main
exe.run(predict_startup)
File "/****/lib/python2.7/site-packages/paddle/fluid/executor.py", line 472, in run
self.executor.run(program.desc, scope, 0, True, True)
paddle.fluid.core.EnforceNotMet: cudaGetDeviceCount failed in paddle::platform::GetCUDADeviceCount: no CUDA-capable device is detected at [/paddle/paddle/fluid/platform/gpu_info.cc:65]
若指定CUDA_VISIBLE_DEVICES,在预测过程中predict_pyreader直接抛出fluid.core.EOFException,不对数据进行处理。