{"id":963737,"date":"2024-12-27T04:21:24","date_gmt":"2024-12-26T20:21:24","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/963737.html"},"modified":"2024-12-27T04:21:26","modified_gmt":"2024-12-26T20:21:26","slug":"python%e5%a6%82%e4%bd%95%e6%9f%a5%e7%9c%8bgpu%e8%bf%90%e7%ae%97","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/963737.html","title":{"rendered":"python\u5982\u4f55\u67e5\u770bgpu\u8fd0\u7b97"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24180855\/81c1f37c-94c4-43e2-a96a-bccecd1836a7.webp\" alt=\"python\u5982\u4f55\u67e5\u770bgpu\u8fd0\u7b97\" \/><\/p>\n<p><p> <strong>\u8981\u67e5\u770bPython\u4e2d\u7684GPU\u8fd0\u7b97\u60c5\u51b5\uff0c\u53ef\u4ee5\u4f7f\u7528\u8bf8\u5982TensorFlow\u3001PyTorch\u7b49\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6\u7684\u5185\u7f6e\u5de5\u5177\u3001\u901a\u8fc7NVIDIA\u63d0\u4f9b\u7684nvidia-smi\u5de5\u5177\u3001\u5229\u7528\u7279\u5b9a\u5e93\u5982CuPy\u8fdb\u884cGPU\u64cd\u4f5c\u3002<\/strong>\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5176\u4e2d\u4e00\u79cd\u65b9\u6cd5\uff1a\u901a\u8fc7\u4f7f\u7528nvidia-smi\u5de5\u5177\u6765\u76d1\u63a7GPU\u7684\u8fd0\u7b97\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><p>nvidia-smi\u662fNVIDIA\u63d0\u4f9b\u7684\u4e00\u4e2a\u7528\u4e8e\u76d1\u63a7\u548c\u7ba1\u7406GPU\u7684\u547d\u4ee4\u884c\u5de5\u5177\u3002\u5b83\u53ef\u4ee5\u663e\u793aGPU\u7684\u4f7f\u7528\u60c5\u51b5\u3001\u6e29\u5ea6\u3001\u529f\u8017\u7b49\u4fe1\u606f\u3002\u8fd9\u5bf9\u4e8e\u5728Python\u73af\u5883\u4e2d\u8fd0\u884cGPU\u52a0\u901f\u7684\u7a0b\u5e8f\u65f6\uff0c\u975e\u5e38\u6709\u7528\u3002\u8981\u4f7f\u7528nvidia-smi\u67e5\u770bGPU\u8fd0\u7b97\u60c5\u51b5\uff0c\u53ea\u9700\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>nvidia-smi<\/code>\uff0c\u5373\u53ef\u770b\u5230\u5f53\u524dGPU\u7684\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528NVIDIA-SMI\u67e5\u770bGPU\u72b6\u6001<\/h3>\n<\/p>\n<p><p>nvidia-smi\u5de5\u5177\u662fNVIDIA\u663e\u5361\u9a71\u52a8\u7a0b\u5e8f\u4e2d\u9644\u5e26\u7684\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u4e8e\u76d1\u63a7GPU\u7684\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5\u548c\u8fd0\u884cnvidia-smi<\/h4>\n<\/p>\n<p><p>\u901a\u5e38\uff0cnvidia-smi\u968fNVIDIA\u663e\u5361\u9a71\u52a8\u4e00\u8d77\u5b89\u88c5\u3002\u5982\u679c\u60a8\u7684\u7cfb\u7edf\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86NVIDIA\u9a71\u52a8\u7a0b\u5e8f\uff0c\u90a3\u4e48\u60a8\u53ef\u4ee5\u901a\u8fc7\u6253\u5f00\u547d\u4ee4\u884c\u7ec8\u7aef\u5e76\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u8fd0\u884cnvidia-smi\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">nvidia-smi<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6b64\u547d\u4ee4\u5c06\u663e\u793a\u5f53\u524dGPU\u7684\u4f7f\u7528\u60c5\u51b5\uff0c\u5305\u62ecGPU\u5229\u7528\u7387\u3001\u663e\u5b58\u4f7f\u7528\u60c5\u51b5\u3001\u6e29\u5ea6\u7b49\u4fe1\u606f\u3002<\/p>\n<\/p>\n<p><h4>2. \u7406\u89e3nvidia-smi\u8f93\u51fa<\/h4>\n<\/p>\n<p><p>nvidia-smi\u7684\u8f93\u51fa\u901a\u5e38\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u91cd\u8981\u90e8\u5206\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>GPU Utilization<\/strong>\uff1a\u663e\u793aGPU\u7684\u5f53\u524d\u4f7f\u7528\u7387\uff08\u4ee5\u767e\u5206\u6bd4\u8868\u793a\uff09\u3002\u8fd9\u662f\u67e5\u770bGPU\u8fd0\u7b97\u8d1f\u8f7d\u7684\u5173\u952e\u6307\u6807\u3002<\/li>\n<li><strong>Memory Usage<\/strong>\uff1a\u663e\u793aGPU\u663e\u5b58\u7684\u4f7f\u7528\u60c5\u51b5\uff0c\u5305\u62ec\u5df2\u7528\u663e\u5b58\u548c\u603b\u663e\u5b58\u3002<\/li>\n<li><strong>Temperature<\/strong>\uff1a\u663e\u793aGPU\u7684\u5f53\u524d\u6e29\u5ea6\u3002<\/li>\n<li><strong>Processes<\/strong>\uff1a\u663e\u793a\u6b63\u5728\u4f7f\u7528GPU\u7684\u8fdb\u7a0b\u4fe1\u606f\uff0c\u5305\u62ec\u8fdb\u7a0bID\u3001\u7528\u6237\u3001\u4f7f\u7528\u7684\u663e\u5b58\u91cf\u7b49\u3002<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u8fd9\u4e9b\u4fe1\u606f\uff0c\u60a8\u53ef\u4ee5\u4e86\u89e3\u5f53\u524d\u7cfb\u7edf\u4e2dGPU\u7684\u4f7f\u7528\u60c5\u51b5\uff0c\u5e76\u5224\u65adPython\u7a0b\u5e8f\u662f\u5426\u6b63\u5728\u6709\u6548\u5229\u7528GPU\u8d44\u6e90\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u5728Python\u4e2d\u5229\u7528TensorFlow\u67e5\u770bGPU\u4f7f\u7528\u60c5\u51b5<\/h3>\n<\/p>\n<p><p>TensorFlow\u662f\u4e00\u4e2a\u5e7f\u6cdb\u4f7f\u7528\u7684\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6\uff0c\u652f\u6301GPU\u52a0\u901f\u8ba1\u7b97\u3002\u901a\u8fc7TensorFlow\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u5730\u67e5\u770b\u548c\u7ba1\u7406GPU\u8bbe\u5907\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5TensorFlow<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u786e\u4fdd\u60a8\u7684\u7cfb\u7edf\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86TensorFlow\u3002\u5982\u679c\u5c1a\u672a\u5b89\u88c5\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install tensorflow<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u67e5\u770b\u53ef\u7528\u7684GPU\u8bbe\u5907<\/h4>\n<\/p>\n<p><p>\u5728Python\u7a0b\u5e8f\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7TensorFlow\u6765\u67e5\u770b\u5f53\u524d\u53ef\u7528\u7684GPU\u8bbe\u5907\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import tensorflow as tf<\/p>\n<h2><strong>\u5217\u51fa\u6240\u6709\u53ef\u7528\u7684\u7269\u7406GPU\u8bbe\u5907<\/strong><\/h2>\n<p>gpus = tf.config.list_physical_devices(&#39;GPU&#39;)<\/p>\n<p>print(&quot;Av<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>lable GPUs:&quot;, gpus)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u63a7\u5236GPU\u7684\u4f7f\u7528<\/h4>\n<\/p>\n<p><p>TensorFlow\u63d0\u4f9b\u4e86\u4e00\u4e9b\u65b9\u6cd5\u6765\u63a7\u5236GPU\u7684\u4f7f\u7528\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u9650\u5236GPU\u7684\u663e\u5b58\u4f7f\u7528\u91cf\uff0c\u4ee5\u9632\u6b62\u7a0b\u5e8f\u5360\u7528\u8fc7\u591a\u7684GPU\u8d44\u6e90\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u9650\u5236GPU\u4f7f\u7528\u7684\u663e\u5b58<\/p>\n<p>for gpu in gpus:<\/p>\n<p>    tf.config.experimental.set_memory_growth(gpu, True)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6bb5\u4ee3\u7801\u5c06\u8bbe\u7f6eTensorFlow\u4f7f\u7528GPU\u65f6\u6309\u9700\u5206\u914d\u663e\u5b58\uff0c\u800c\u4e0d\u662f\u4e00\u6b21\u6027\u5360\u7528\u6240\u6709\u53ef\u7528\u663e\u5b58\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u5728Python\u4e2d\u5229\u7528PyTorch\u67e5\u770bGPU\u4f7f\u7528\u60c5\u51b5<\/h3>\n<\/p>\n<p><p>PyTorch\u662f\u53e6\u4e00\u4e2a\u6d41\u884c\u7684\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6\uff0c\u5b83\u4e5f\u63d0\u4f9b\u4e86\u5bf9GPU\u7684\u826f\u597d\u652f\u6301\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5PyTorch<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u786e\u4fdd\u60a8\u7684\u7cfb\u7edf\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86PyTorch\u3002\u5982\u679c\u5c1a\u672a\u5b89\u88c5\uff0c\u53ef\u4ee5\u8bbf\u95eePyTorch\u5b98\u65b9\u7f51\u7ad9\u6839\u636e\u60a8\u7684\u73af\u5883\u751f\u6210\u5b89\u88c5\u547d\u4ee4\u3002<\/p>\n<\/p>\n<p><h4>2. \u67e5\u770b\u53ef\u7528\u7684GPU\u8bbe\u5907<\/h4>\n<\/p>\n<p><p>\u5728PyTorch\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u6765\u67e5\u770b\u5f53\u524d\u53ef\u7528\u7684GPU\u8bbe\u5907\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import torch<\/p>\n<h2><strong>\u68c0\u67e5\u662f\u5426\u6709\u53ef\u7528\u7684GPU<\/strong><\/h2>\n<p>if torch.cuda.is_available():<\/p>\n<p>    print(&quot;Available GPU:&quot;, torch.cuda.get_device_name(0))<\/p>\n<p>else:<\/p>\n<p>    print(&quot;No GPU available.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u63a7\u5236GPU\u7684\u4f7f\u7528<\/h4>\n<\/p>\n<p><p>\u5728PyTorch\u4e2d\uff0c\u60a8\u53ef\u4ee5\u9009\u62e9\u5c06\u6a21\u578b\u548c\u6570\u636e\u79fb\u52a8\u5230GPU\u4e0a\u8fdb\u884c\u8ba1\u7b97\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u4e00\u4e2a\u5f20\u91cf\u5e76\u79fb\u52a8\u5230GPU<\/p>\n<p>device = torch.device(&quot;cuda&quot; if torch.cuda.is_available() else &quot;cpu&quot;)<\/p>\n<p>tensor = torch.randn(2, 3).to(device)<\/p>\n<p>print(tensor)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6bb5\u4ee3\u7801\u5c06\u521b\u5efa\u4e00\u4e2a\u968f\u673a\u5f20\u91cf\uff0c\u5e76\u5c06\u5176\u79fb\u52a8\u5230GPU\u4e0a\u8fdb\u884c\u8fd0\u7b97\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528CuPy\u8fdb\u884cGPU\u8ba1\u7b97<\/h3>\n<\/p>\n<p><p>CuPy\u662f\u4e00\u4e2a\u7528\u4e8eNVIDIA GPU\u7684\u6570\u7ec4\u8ba1\u7b97\u5e93\uff0c\u63d0\u4f9b\u4e86\u4e0eNumPy\u517c\u5bb9\u7684\u63a5\u53e3\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5CuPy<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u786e\u4fdd\u60a8\u7684\u7cfb\u7edf\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86CuPy\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install cupy-cudaXX  # XX\u66ff\u6362\u4e3a\u60a8\u7684CUDA\u7248\u672c\u53f7\uff0c\u4f8b\u5982cupy-cuda102<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u4f7f\u7528CuPy\u8fdb\u884c\u8ba1\u7b97<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528CuPy\uff0c\u60a8\u53ef\u4ee5\u50cf\u4f7f\u7528NumPy\u4e00\u6837\u8fdb\u884c\u6570\u7ec4\u64cd\u4f5c\uff0c\u4f46\u8fd9\u4e9b\u64cd\u4f5c\u5c06\u88ab\u52a0\u901f\u5e76\u5728GPU\u4e0a\u6267\u884c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cupy as cp<\/p>\n<h2><strong>\u521b\u5efaCuPy\u6570\u7ec4<\/strong><\/h2>\n<p>x = cp.array([1, 2, 3, 4, 5])<\/p>\n<p>y = cp.array([6, 7, 8, 9, 10])<\/p>\n<h2><strong>\u5728GPU\u4e0a\u8fdb\u884c\u6570\u7ec4\u8ba1\u7b97<\/strong><\/h2>\n<p>z = x + y<\/p>\n<p>print(z)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6bb5\u4ee3\u7801\u5c06\u5728GPU\u4e0a\u6267\u884c\u6570\u7ec4\u52a0\u6cd5\u8fd0\u7b97\uff0c\u5e76\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u603b\u7ed3\u4e0e\u6700\u4f73\u5b9e\u8df5<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\u67e5\u770b\u548c\u7ba1\u7406GPU\u8fd0\u7b97\u60c5\u51b5\uff0c\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u5229\u7528GPU\u8d44\u6e90\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6027\u80fd\u3002\u5728\u4f7f\u7528GPU\u52a0\u901f\u8ba1\u7b97\u65f6\uff0c\u5efa\u8bae\u9075\u5faa\u4ee5\u4e0b\u6700\u4f73\u5b9e\u8df5\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>\u5b9a\u671f\u76d1\u63a7GPU\u72b6\u6001<\/strong>\uff1a\u4f7f\u7528nvidia-smi\u7b49\u5de5\u5177\u5b9a\u671f\u67e5\u770bGPU\u7684\u4f7f\u7528\u60c5\u51b5\uff0c\u4ee5\u786e\u4fdd\u7a0b\u5e8f\u9ad8\u6548\u8fd0\u884c\u3002<\/li>\n<li><strong>\u5408\u7406\u5206\u914d\u8d44\u6e90<\/strong>\uff1a\u901a\u8fc7TensorFlow\u3001PyTorch\u7b49\u6846\u67b6\u7684\u914d\u7f6e\u9009\u9879\uff0c\u5408\u7406\u5206\u914dGPU\u663e\u5b58\u548c\u8ba1\u7b97\u8d44\u6e90\uff0c\u907f\u514d\u8d44\u6e90\u6d6a\u8d39\u3002<\/li>\n<li><strong>\u4f18\u5316\u4ee3\u7801\u6027\u80fd<\/strong>\uff1a\u5728\u786e\u4fddGPU\u6b63\u5e38\u5de5\u4f5c\u7684\u57fa\u7840\u4e0a\uff0c\u8fdb\u4e00\u6b65\u4f18\u5316\u4ee3\u7801\u903b\u8f91\u548c\u7b97\u6cd5\uff0c\u4ee5\u5145\u5206\u53d1\u6325GPU\u7684\u8ba1\u7b97\u80fd\u529b\u3002<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u5728Python\u4e2d\u9ad8\u6548\u5730\u67e5\u770b\u548c\u7ba1\u7406GPU\u8fd0\u7b97\u60c5\u51b5\uff0c\u4ece\u800c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6574\u4f53\u6027\u80fd\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u68c0\u67e5GPU\u662f\u5426\u53ef\u7528\uff1f<\/strong><br \/>\u60a8\u53ef\u4ee5\u4f7f\u7528\u5e93\u5982TensorFlow\u6216PyTorch\u6765\u68c0\u67e5GPU\u7684\u53ef\u7528\u6027\u3002\u5728TensorFlow\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>tf.config.list_physical_devices(&#39;GPU&#39;)<\/code>\u6765\u5217\u51fa\u6240\u6709\u53ef\u7528\u7684GPU\u3002\u5728PyTorch\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>torch.cuda.is_available()<\/code>\u6765\u68c0\u67e5GPU\u662f\u5426\u53ef\u7528\u3002\u8fd9\u4e24\u79cd\u65b9\u6cd5\u90fd\u80fd\u5e2e\u52a9\u60a8\u786e\u8ba4\u60a8\u7684\u73af\u5883\u662f\u5426\u652f\u6301GPU\u8fd0\u7b97\u3002<\/p>\n<p><strong>\u4f7f\u7528Python\u8fdb\u884cGPU\u8fd0\u7b97\u7684\u6700\u4f73\u5e93\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u6709\u51e0\u4e2a\u6d41\u884c\u7684\u5e93\u652f\u6301GPU\u8fd0\u7b97\u3002TensorFlow\u548cPyTorch\u662f\u6700\u5e38\u7528\u7684\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6\uff0c\u5b83\u4eec\u90fd\u63d0\u4f9b\u4e86\u5bf9GPU\u7684\u9ad8\u6548\u652f\u6301\u3002\u9664\u6b64\u4e4b\u5916\uff0cCuPy\u662f\u4e00\u4e2a\u517c\u5bb9NumPy\u7684\u5e93\uff0c\u4e13\u4e3aGPU\u52a0\u901f\u800c\u8bbe\u8ba1\u3002\u5bf9\u4e8e\u79d1\u5b66\u8ba1\u7b97\uff0cNVIDIA\u7684Numba\u5e93\u4e5f\u80fd\u901a\u8fc7\u7b80\u5355\u7684\u88c5\u9970\u5668\u5b9e\u73b0GPU\u52a0\u901f\u3002<\/p>\n<p><strong>\u5982\u4f55\u76d1\u63a7GPU\u7684\u4f7f\u7528\u60c5\u51b5\uff1f<\/strong><br \/>\u60a8\u53ef\u4ee5\u4f7f\u7528NVIDIA\u63d0\u4f9b\u7684\u5de5\u5177\uff0c\u5982NVIDIA SMI\uff08System Management Interface\uff09\uff0c\u6765\u76d1\u63a7GPU\u7684\u4f7f\u7528\u60c5\u51b5\u3002\u901a\u8fc7\u547d\u4ee4\u884c\u8f93\u5165<code>nvidia-smi<\/code>\uff0c\u53ef\u4ee5\u67e5\u770bGPU\u7684\u5229\u7528\u7387\u3001\u663e\u5b58\u4f7f\u7528\u60c5\u51b5\u548c\u8fd0\u884c\u7684\u8fdb\u7a0b\u3002\u6b64\u5916\uff0c\u8fd8\u6709\u4e00\u4e9bPython\u5e93\uff0c\u5982GPUtil\uff0c\u53ef\u4ee5\u5728\u60a8\u7684Python\u811a\u672c\u4e2d\u76f4\u63a5\u83b7\u53d6GPU\u7684\u72b6\u6001\u548c\u6027\u80fd\u6307\u6807\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u67e5\u770bPython\u4e2d\u7684GPU\u8fd0\u7b97\u60c5\u51b5\uff0c\u53ef\u4ee5\u4f7f\u7528\u8bf8\u5982TensorFlow\u3001PyTorch\u7b49\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6\u7684\u5185\u7f6e\u5de5\u5177 [&hellip;]","protected":false},"author":3,"featured_media":963744,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/963737"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=963737"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/963737\/revisions"}],"predecessor-version":[{"id":963747,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/963737\/revisions\/963747"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/963744"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=963737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=963737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=963737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}