gpt4 book ai didi

import - "import theano"运行需要多长时间?

转载 作者:行者123 更新时间:2023-12-02 01:39:37 27 4
gpt4 key购买 nike

我正在 Windows 上使用 Theano 进行深度学习实验的第一步,我很惊讶仅仅加载库需要多少时间。

这是小测试程序:

from time import time
t0 = time()
import theano
t1 = time()
print 'import theano takes %f' %(t1-t0)

我的 PyCharm 控制台中的结果:

C:\Anaconda\python.exe X:/DAR_EPT/DNN/dnn_tuto1.py
Using gpu device 0: Quadro K2000M
import theano takes 23.044000 seconds

:-o

这是正常行为吗?我应该重新安装所有东西吗?

这是我的配置:

Windows 7。“Anaconda”包中的 Python 2.7.8。 CUDA 6.5。 GPU:Nvidia Quadro K2000M。

这是 .theanorc 文件:

[global]
floatX = float32
device = gpu

[nvcc]
fastmath = True

最佳答案

当配置为使用 GPU 时,import theano 通常需要很长时间。在我的机器上,在 CPU 上运行时需要 0.567 秒,在 GPU 上运行时需要 13.3 秒。

这可能是为什么一开始在 CPU 上开发然后在它运行正常后切换到 GPU 的原因之一。在确定在 GPU 上运行是否真的值得时,需要考虑 GPU 开销,包括增加的 Theano 启动时间。

关于import - "import theano"运行需要多长时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29209935/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com