简体   繁体   English

我的 CNN 模型在我的 GPU 上使用了太多内存。 如何在我的 CPU 内存上托管一些张量?

[英]My CNN Model uses too much memory on my GPU. How can I host some Tensors on my CPU memory?

I'm training a CNN model on an NVidia RTX 2080, it became bigger and bigger and I have now some memory issues with the card.我正在 NVidia RTX 2080 上训练一个 CNN 模型,它变得越来越大,现在我的卡出现了一些内存问题。 I read some paper about this subject, and it seems possible with Tensorflow to host some nodes on the CPU memory during the training and retrieve it in the GPU memory later when needed (as in http://learningsys.org/nips17/assets/papers/paper_18.pdf ).我读了一些关于这个主题的论文,似乎可以使用 Tensorflow 在训练期间在 CPU 内存上托管一些节点,并在需要时在 GPU 内存中检索它(如http://learningsys.org/nips17/assets/论文/paper_18.pdf )。

Any ideas/docs/examples?任何想法/文档/示例?

Thanks!谢谢!

Without any code it's difficult to help.没有任何代码很难提供帮助。 Generally you can take a look at the documentation .一般你可以看看文档

For example with:例如:

with tf.device('/cpu:0'):
  a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
  b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')

you can create variables explicitly on the cpu.您可以在 cpu 上显式创建变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何防止我的 Python 程序在我的 SQL 服务器上使用过多的 memory? - How do I keep my Python program from using too much memory on my SQL Server? Tensorflow 使用 CPU 代替 GPU。 怎么修? - Tensorflow uses CPU instead of GPU. How to fix? 我没有在 GPU 上运行任何东西。 但是 GPU stat 没有清除我的使用情况 - Im not running anything on GPU. But GPU stat is not clearing my usage 我的程序使用了很多ram内存,我该怎么办? - My program uses a lot of ram memory, what can I do? 我的合并重叠坐标 python 脚本花费太多 memory - My merge overlapping coordinate python script cost too much memory 如何提高我的 CNN 模型的准确性 - How Can I Increase My CNN Model's Accuracy Tensorflow如何使用我的gpu? - How Tensorflow uses my gpu? 为什么当我调用使用 GPU 上已经存在的张量的方法时,GPU memory 的使用量正在增加? - Why GPU memory usage is increasing when I call a method that uses tensors already exist on GPU? 检查键盘输入使用过多的 CPU 使用率,我的代码有问题吗? - Checking for keyboard inputs uses too much cpu usage, Is there something wrong with my code? 如何使用 GPU 而不是 CPU 训练我的 ChatterBot model - How to train my ChatterBot model using GPU instead of CPU
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM