安装了gpu版本后,keras预测也使用了GPU。由于项目要求测试CPU下速度,因此,在python调用代码中,做如下限制: import os os.environ["CUDA_VISIBLE_DEVICES"] = "-1"