我目前正在尝试使用tensorflow 2.6 和 CuDNN 运行基于文本的序列到序列模型。
代码正在运行,但花费的时间令人怀疑。当我检查任务管理器时,我看到以下内容:
这对我来说看起来很奇怪,因为所有内存都被占用,但它并没有承受重负载。这是预期的行为吗?
系统:
在代码中我发现了以下GPU设置
def get_gpu_config():
gconfig = tf.compat.v1.ConfigProto()
gconfig.gpu_options.per_process_gpu_memory_fraction = 0.975 # Don't take 100% of the memory
gconfig.allow_soft_placement = True # Does not aggressively take all the GPU memory
gconfig.gpu_options.allow_growth = True # Take more memory when necessary
return gconfig
Run Code Online (Sandbox Code Playgroud)
我的 python 输出告诉我它找到了我的显卡:
我可能缺少配置吗?它所花费的时间与我在 CPU 系统上所花费的时间相似,这对我来说似乎不太合适。
边注:
我尝试运行的代码必须从tensorflow-gpu 1.12迁移,但这“相对”顺利。
tensorflow ×1