{"id":219477,"date":"2021-06-13T10:46:15","date_gmt":"2021-06-13T02:46:15","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=219477"},"modified":"2021-05-25T08:47:00","modified_gmt":"2021-05-25T00:47:00","slug":"pytorch-gpu-solution","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/pytorch-gpu-solution.html","title":{"rendered":"\u89e3\u51b3pytorch-gpu \u5b89\u88c5\u5931\u8d25\u65b9\u6848"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4ecb\u7ecd\u4e86\u89e3\u51b3pytorch-gpu \u5b89\u88c5\u5931\u8d25\u7684\u8bb0\u5f55\uff0c\u5177\u6709\u5f88\u597d\u7684\u53c2\u8003\u4ef7\u503c\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9\u3002\u5982\u6709\u9519\u8bef\u6216\u672a\u8003\u8651\u5b8c\u5168\u7684\u5730\u65b9\uff0c\u671b\u4e0d\u541d\u8d50\u6559<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

ubuntu18 \u7cfb\u7edf\u4e0a\u5df2\u7ecf\u914d\u7f6e\u597dgpu\u52a0\u901f\u73af\u5883<\/p>\n

\u5b89\u88c5pytorch-gpu \u540e\u51fa\u73b0\u4ee5\u4e0b\u95ee\u9898\uff1a<\/strong><\/span><\/div>\n
\r\nimport torch\r\nx = torch.Tensor(2,3)\r\nx_cuda = x.cuda()\r\n<\/pre>\n

x\u53ef\u4ee5\u6b63\u5e38\uff0c\u5f53\u5b9a\u4e49x_cuda \u540e\uff0c\u547d\u4ee4\u884c\u5361\u4f4f\uff0c\u4e0d\u518d\u7ee7\u7eed\u8f93\u51fa<\/p>\n

\u51e0\u5468\u540e\u7ec8\u4e8e\u627e\u5230\u4e86\u539f\u56e0\uff1a<\/strong><\/span><\/div>\n

\u5f53\u521dpytorch-gpu\u4e3a1.0\u7248\u672c\uff0c\u7136\u800c\u914d\u7f6e\u7684cuda\u548ccudnn\u7248\u672c\u8f83\u4f4e\uff0c\u4e0d\u652f\u6301\u9ad8\u7248\u672c\u7684pytorch,\u540e\u6765\u9009\u62e9\u5b89\u88c5 0.4.1\u7248\u672c\u7684pytorch\uff0c\u89e3\u51b3\u6b64\u95ee\u9898\u3002<\/p>\n

\u5f53\u524d\u73af\u5883\u662f torch-0.4.1-cp36 +384\u663e\u5361\u9a71\u52a8+cuda8.0+cudnn6.0\u3002<\/p>\n

\u51e0\u591a\u8270\u8f9b\uff0c\u5f97\u4ee5\u5f00\u989c\u3002<\/p>\n

\u8865\u5145\uff1aconda\u5b89\u88c5pytorch-gpu\u7248\u672c\u4e0b\u8f7d\u51fa\u9519\u7684\u95ee\u9898\u89e3\u51b3<\/strong><\/p>\n

\u6362\u4e86\u6e05\u534e\u7684\u6e90\u4e4b\u540e\uff0c\u5b98\u7f51\u7684\u547d\u4ee4\u662f\u4e0b\u9762\u7684\uff1a<\/p>\n

\r\nconda install pytorch=1.1.0 torchvision=0.3.0 cudatoolkit=9.0 -c pytorch\r\n<\/pre>\n

\u4f46\u662f\u7ecf\u5e38\u4f1a\u62a5HTTP error\u7684\u9519\u8bef\uff0c\u5c06-c pytorch\u5220\u9664\u5373\u53ef<\/p>\n

\r\nconda install pytorch=1.1.0 torchvision=0.3.0 cudatoolkit=9.0\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

ubuntu18 \u7cfb\u7edf\u4e0a\u5df2\u7ecf\u914d\u7f6e\u597dgpu\u52a0\u901f\u73af\u5883 import torch x = torch.Tensor( […]<\/p>\n","protected":false},"author":668,"featured_media":110263,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-219477","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/219477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/668"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=219477"}],"version-history":[{"count":1,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/219477\/revisions"}],"predecessor-version":[{"id":219478,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/219477\/revisions\/219478"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/110263"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=219477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=219477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=219477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}