{"id":149,"date":"2024-04-12T12:40:55","date_gmt":"2024-04-12T04:40:55","guid":{"rendered":"http:\/\/www.zkjia.com\/?p=149"},"modified":"2024-04-12T12:40:57","modified_gmt":"2024-04-12T04:40:57","slug":"jiejuestable-diffusion-gengxinlepytorch-tishicuowuvenvlibsite-packagestorchaudiolib","status":"publish","type":"post","link":"http:\/\/www.zkjia.com\/?p=149","title":{"rendered":"\u89e3\u51b3\uff1aStable Diffusion \u66f4\u65b0\u4e86Pytorch \u63d0\u793a\u9519\u8bef\uff1avenv\\Lib\\site-packages\\torchaudio\\lib\\libtorchaudio.pyd\u2019 . Try using the full path with constructor syntax.)."},"content":{"rendered":"\n<p>SD\u6709\u4e00\u6bb5\u65f6\u95f4\u6ca1\u6709\u7528\u8fc7\u4e86\uff0c\u60f3\u7740\u5f00\u6e90\u4ee3\u7801\u7684\u4f18\u5316\uff0c\u4e2d\u95f4\u4ef6\u7684\u4f18\u5316\uff0c\u8ba1\u7b97\u901f\u5ea6\u4f1a\u6709\u6240\u63d0\u5347\uff0c\u4e8e\u662f\u5728\u4f7f\u7528\u4e4b\u524d\u7528\u4e86\u4e0b git pull \u5e76\u66f4\u65b0\u4e86 \u00a0torch: 2.1.2+cu121  xformers: 0.0.23.<\/p>\n\n\n\n<p>\u66f4\u65b0\u540e\uff0c\u78b0\u5230\u9519\u8bef\uff1a<\/p>\n\n\n\n<p>venv\\Lib\\site-packages\\torchaudio\\lib\\libtorchaudio.pyd\u2019 . Try using the full path with constructor syntax.).<\/p>\n\n\n\n<p>\u65e0\u6cd5\u6267\u884c\u63d0\u793a\u62a5\u9519\u3002\u4e2d\u95f4\u987a\u4fbf\u66f4\u65b0\u4e86pip\u7684\u7248\u672c\u52302.4<\/p>\n\n\n\n<p>\u6298\u817e\u4e86\u51e0\u4e2a\u5c0f\u65f6\u65e0\u679c\u540e\uff0c\u5e72\u6389\u4e86 Stable diffusion \u76ee\u5f55\u4e0b\u7684 venv\u76ee\u5f55\uff08windows\u7cfb\u7edf\uff09<\/p>\n\n\n\n<p>\u91cd\u65b0\u6267\u884csd\u91cd\u6784venv\u76ee\u5f55\uff0c\u91cd\u6784\u8fc7\u7a0b\u4f1a\u6839\u636e\u5f53\u524dpython\u73af\u5883\u6240\u5728\u4f4d\u7f6e\uff08<\/p>\n\n\n\n<p>\u5728\u6b64\u4e4b\u524dAnaconda\u91cd\u5efa\u4e86\u4e00\u4e2apython 3.10.14\u5e72\u51c0\u73af\u5883\uff0c\u5728\u73af\u5883\u91cc\u88c5\u5165 <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pip3 install torch torchvision torchaudio --index-url https:\/\/download.pytorch.org\/whl\/cu121<\/pre>\n\n\n\n<p>\u548c xformers<\/p>\n\n\n\n<p>\u5e76\u6267\u884c\u4e86SD\u76ee\u5f55\u4e0b\u7684 pip install -r requirements.txt<\/p>\n\n\n\n<p>\uff09\u62f7\u8d1d\u5230venv\u76ee\u5f55\u3002<\/p>\n\n\n\n<p>\u6015\u91cd\u6784\u8fc7\u7a0b\u7a0b\u5e8f\u4f9d\u8d56\u53e0\u52a0\u751f\u53d8\uff0c<\/p>\n\n\n\n<p>\u5728SD\\venv\\Scripts\\\u7528\u6b64\u76ee\u5f55\u4e0b\u7684pip \u6267\u884c\u4e86<br><br>pip install -U xformers<br>pip install &#8211;force-reinstall torchivsion<\/p>\n\n\n\n<p>\u6574\u4e2a\u8fc7\u7a0b\u56e0\u4e3a\u7275\u6d89\u4e0b\u8f7d\u5b89\u88c5\u4f9d\u8d56\u9879\uff0c\u9700\u8981\u6f2b\u957f\u7684\u7b49\u5f85\uff0c\u5b8c\u4e8b\u513f\u540e\u518d\u6267\u884cSD\uff0c\u6211\u8fd9\u91cc\u8fd8\u6709\u4e00\u4e9b\u6269\u5c55\u7684\u4f9d\u8d56\u62a5\u9519\uff08GitHub\u4e0a\u9762\u4e00\u5e74\u4ee5\u4e0a\u672a\u66f4\u65b0\u7684\u6269\u5c55\uff09\uff0c\u4f46\u662f\u5df2\u7ecf\u53ef\u4ee5\u6b63\u5e38\u8fd0\u884c\u8d77\u6765\u4e86\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u6574\u4f53\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<p>1\u3001\u91cd\u5efa\u4e00\u4e2a\u5e72\u51c0\u7684python\u73af\u5883\uff0c\u505a\u597dpath\u8bbe\u5b9a\uff08windows11\uff09\uff0c\u5220\u9664\u6389\u65e7SD\u76ee\u5f55\u4e0b\u7684venv\u76ee\u5f55<\/p>\n\n\n\n<p>2\u3001\u4e3a\u5e72\u51c0\u7684python \u5b89\u88c5SD\u7684\u4f9d\u8d56\u9879 requirements.txt\u4e0b\u7684<\/p>\n\n\n\n<p>3\u3001\u5b89\u88c5\u597d torch\u5bf9\u5e94\u7684 CUDA(\u9700\u8981\u5230\u82f1\u4f1f\u8fbe\u4e0b\u8f7d\uff0c\u8fd9\u91cc\u53ea\u8bf4N\u5361\uff09\u6211\u662fv12.4\u7248\u672c\uff0c\u7136\u540e\u5b89\u88c5torch (https:\/\/pytorch.org\/get-started\/locally\/) \u548c  xformers<\/p>\n\n\n\n<p>4\u3001\u89e3\u51b3\u6389\u4e4b\u524d\u5b89\u88c5\u7684extensions\u4e2d\u7684\u4f9d\u8d56\u5982\u679c\u78b0\u5230\u8bb8\u4e45\u672a\u66f4\u65b0\u7684\u53c8\u662f\u53ef\u6709\u53ef\u65e0\u7684\uff0c\u53ef\u4ee5\u679c\u65ad\u5220\u9664\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SD\u6709\u4e00\u6bb5\u65f6\u95f4\u6ca1\u6709\u7528\u8fc7\u4e86\uff0c\u60f3\u7740\u5f00\u6e90\u4ee3\u7801\u7684\u4f18\u5316\uff0c\u4e2d\u95f4\u4ef6\u7684\u4f18\u5316\uff0c\u8ba1\u7b97\u901f\u5ea6\u4f1a\u6709\u6240\u63d0\u5347\uff0c\u4e8e\u662f\u5728\u4f7f\u7528\u4e4b\u524d\u7528\u4e86\u4e0b git  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,5],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/www.zkjia.com\/index.php?rest_route=\/wp\/v2\/posts\/149"}],"collection":[{"href":"http:\/\/www.zkjia.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zkjia.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zkjia.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zkjia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=149"}],"version-history":[{"count":1,"href":"http:\/\/www.zkjia.com\/index.php?rest_route=\/wp\/v2\/posts\/149\/revisions"}],"predecessor-version":[{"id":150,"href":"http:\/\/www.zkjia.com\/index.php?rest_route=\/wp\/v2\/posts\/149\/revisions\/150"}],"wp:attachment":[{"href":"http:\/\/www.zkjia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zkjia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zkjia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}