{"id":46,"date":"2022-10-12T22:11:48","date_gmt":"2022-10-12T14:11:48","guid":{"rendered":"http:\/\/blog.minegician.cn\/?p=46"},"modified":"2023-01-15T16:26:31","modified_gmt":"2023-01-15T08:26:31","slug":"%e7%ae%80%e5%8d%95%e7%9a%84%e7%82%bc%e4%b8%b9%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"http:\/\/blog.minegician.cn\/?p=46","title":{"rendered":"\u7b80\u5355\u7684\u70bc\u4e39\u914d\u7f6e"},"content":{"rendered":"<ol>\n<li>\n<p>pycharm \u7684\u5b89\u88c5<\/p>\n<ul>\n<li>\u5728\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305\uff0c\u5b89\u88c5\u8def\u5f84\u53ef\u4ee5\u81ea\u5b9a\u4e49\uff0c\u6709\u4e00\u6b65\u662f\u6dfb\u52a0\u5230 PATH \u5efa\u8bae\u52fe\u9009<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Anaconda \u7684\u5b89\u88c5<\/p>\n<ul>\n<li>\u5728\u5b98\u7f51\u4e0b\u8f7d win10 64\u4f4d \u5b89\u88c5\u5305\uff0c\u5b89\u88c5\u90fd\u6309\u9ed8\u8ba4\u5373\u53ef\uff0c\u5176\u4e2d\u6709\u4e00\u6b65\u662f\u6dfb\u52a0\u5230 PATH \u5efa\u8bae\u52fe\u9009<\/li>\n<li>\u5b8c\u6210\u540e\u53ef\u4ee5\u5728\u7ec8\u7aef\u4e2d <code>conda -V<\/code> \u67e5\u770b\u7248\u672c<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>CUDA \u5b89\u88c5<\/p>\n<ul>\n<li>\n<p>\u67e5\u770b\u9002\u5408\u7684 CUDA \u7248\u672c<\/p>\n<pre><code class=\"language-shell\">nvidia-smi<\/code><\/pre>\n<\/li>\n<li>\n<p>\u627e\u5230\u5bf9\u5e94\u7248\u672c\u7684 CUDA \u4e0b\u8f7d win10 \u7248\u672c <a href=\"https:\/\/developer.nvidia.com\/cuda-toolkit-archive\">CUDA Toolkit Archive | NVIDIA Developer<\/a><\/p>\n<\/li>\n<li>\n<p>\uff08\u4ee5 CUDA 11.4 \u4e3a\u4f8b\uff09\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884c\uff0c\u52a0\u8f7d\u5b8c\u540e\u9009\u81ea\u5b9a\u4e49\u5b89\u88c5\uff0c\u65b0\u5efa <code>CUDA\/v11.4<\/code> \u76ee\u5f55\uff0c\u4e0b\u9762\u5efa\u4e24\u4e2a\u76ee\u5f55\u5206\u522b\u5b58\u653e development\/document \u548c sample\uff08\u5177\u4f53\u5fd8\u4e86\u53eb\u4ec0\u4e48\uff09\uff0c\u8fd9\u4e09\u9879\u5728\u81ea\u5b9a\u4e49\u5b89\u88c5\u4e2d\u4f1a\u770b\u5230<\/p>\n<\/li>\n<li>\n<p>\u5b8c\u6210\u540e\u91cd\u542f\u7535\u8111\uff0c\u53ef\u5728\u7ec8\u7aef\u4e2d <code>nvcc -V<\/code> \u67e5\u770b\u7248\u672c<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>cuDNN \u914d\u7f6e<\/p>\n<ul>\n<li>\u627e\u5230 CUDA \u7248\u672c\u9002\u914d\u7684 cuDNN <a href=\"https:\/\/developer.nvidia.com\/rdp\/cudnn-archive\">cuDNN Archive | NVIDIA Developer<\/a><\/li>\n<li>\uff08\u4ee5 cuDNN 8.2.4 \u4e3a\u4f8b\uff09\u89e3\u538b\u540e\u5c06 3 \u4e2a\u76ee\u5f55\u590d\u5236\u5230\u521a\u624d\u653e development \u7684\u6587\u4ef6\u5939<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>pytorch \u914d\u7f6e<\/p>\n<ul>\n<li>\n<p>\u5728\u5f00\u59cb\u83dc\u5355\u4e2d\u627e\u5230 <code>Anaconda Prompt (Anaconda3)<\/code> \u6253\u5f00<\/p>\n<\/li>\n<li>\n<p><code>conda create -n pyt python=3.9<\/code> \u65b0\u5efa\u4e00\u4e2a\u540d\u4e3a pyt \u7684\u865a\u62df\u73af\u5883<\/p>\n<\/li>\n<li>\n<p><code>conda activate pyt<\/code> \u8fdb\u5165\u73af\u5883<\/p>\n<\/li>\n<li>\n<p>\u6253\u5f00 pytorch \u5b98\u7f51\uff0c\u70b9\u51fb Get Started \u540e\u9009\u62e9 Previous Versions\u3002\u4ee5 CUDA 11.4 \u548c python3.9 \u4e3a\u4f8b\uff0c\u627e\u5230 pytorch 1.9.0 \u9009\u62e9 CUDA 11.3\uff08\u56e0\u4e3a\u6ca1\u6709 11.4\uff0c\u4f46\u662f\u95ee\u9898\u4e0d\u5927\uff09 \u4e0b\u65b9\u7684\u6307\u4ee4\uff0c\u5728\u4e0a\u9762\u7684\u7ec8\u7aef\u73af\u5883\u4e2d\u5b89\u88c5<\/p>\n<\/li>\n<li>\n<p>pycharm \u65b0\u5efa\u4e00\u4e2a\u9879\u76ee\uff0cpython \u89e3\u91ca\u5668\u9009\u62e9\u521a\u624d\u7684 conda\uff0c\u8fdb\u5165\u540e\u70b9\u51fb\u53f3\u4e0a\u89d2\u8bbe\u7f6e - \u9879\u76ee -\u89e3\u91ca\u5668\uff0c\u70b9\u51fb\u6dfb\u52a0\u672c\u5730\u89e3\u91ca\u5668\uff0c\u9009\u62e9 conda\uff0c\u4e0b\u62c9\u6846\u627e\u5230\u521a\u624d\u7684 <code>pyt<\/code> \u70b9\u786e\u5b9a<\/p>\n<\/li>\n<li>\n<p>\u65b0\u5efa\u4e00\u4e2a <code>.py<\/code> \u6587\u4ef6\uff0c\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\u6d4b\u8bd5\u8f93\u51fa pytorch \u7248\u672c<\/p>\n<pre><code class=\"language-py\">import torch\nprint(torch.__version__)<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>TensorFlow \u914d\u7f6e<\/p>\n<ul>\n<li>\n<p>\u540c\u4e0a\u64cd\u4f5c\uff0c\u65b0\u5efa\u4e00\u4e2a\u540d\u4e3a <code>tf2<\/code> \u7684\u865a\u62df\u73af\u5883\uff0cpython \u7248\u672c\u4e5f\u662f 3.9<\/p>\n<\/li>\n<li>\n<p>\u5b89\u88c5\uff0c\u53ef\u4ee5\u4fee\u6539\u7248\u672c\uff0c\u4ee5 2.5.0 \u4e3a\u4f8b<\/p>\n<pre><code class=\"language-shell\">pip install tensorflow-gpu==2.5.0 -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/code><\/pre>\n<\/li>\n<li>\n<p>\u540c\u6837\u5bf9\u4e00\u4e2a\u9879\u76ee\u9009\u62e9 <code>tf2<\/code> \u89e3\u91ca\u5668\uff0c\u5e76\u7528\u4ee5\u4e0b\u4ee3\u7801\u6d4b\u8bd5<\/p>\n<pre><code class=\"language-py\">import tensorflow as tf\ntf.compat.v1.disable_eager_execution()\nsess = tf.compat.v1.Session()\na=tf.constant(1)\nb=tf.constant(2)\nprint(sess.run(a+b))\n# \u6b63\u5e38\u8f93\u51fa 3<\/code><\/pre>\n<\/li>\n<li>\n<p>\u7a97\u53e3\u53f3\u4e0b\u89d2\u4e00\u5f00\u59cb\u4f1a\u82b1\u51e0\u5206\u949f\u52a0\u8f7d\u73af\u5883\uff0c\u5148\u7b49\u4e00\u7b49<\/p>\n<\/li>\n<li>\n<p>\u6d4b\u8bd5\u6210\u529f\u80fd\u770b\u5230\u5f88\u591a <code>Successfully<\/code> \u8fd8\u6709 GPU \u7684\u4e00\u4e9b\u53c2\u6570\uff08\u5168\u662f\u7ea2\u5b57\uff09\u4ee5\u53ca\u6d4b\u8bd5\u8f93\u51fa\u7ed3\u679c<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>pycharm \u7684\u5b89\u88c5 \u5728\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305\uff0c\u5b89\u88c5\u8def\u5f84\u53ef\u4ee5\u81ea\u5b9a\u4e49\uff0c\u6709\u4e00\u6b65\u662f\u6dfb\u52a0\u5230 PATH \u5efa\u8bae\u52fe\u9009 Anacon [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":122,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-46","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-3"],"_links":{"self":[{"href":"http:\/\/blog.minegician.cn\/index.php?rest_route=\/wp\/v2\/posts\/46","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.minegician.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.minegician.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.minegician.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.minegician.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=46"}],"version-history":[{"count":1,"href":"http:\/\/blog.minegician.cn\/index.php?rest_route=\/wp\/v2\/posts\/46\/revisions"}],"predecessor-version":[{"id":48,"href":"http:\/\/blog.minegician.cn\/index.php?rest_route=\/wp\/v2\/posts\/46\/revisions\/48"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/blog.minegician.cn\/index.php?rest_route=\/wp\/v2\/media\/122"}],"wp:attachment":[{"href":"http:\/\/blog.minegician.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=46"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.minegician.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=46"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.minegician.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=46"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}