{"id":52283,"date":"2024-10-09T01:20:16","date_gmt":"2024-10-08T17:20:16","guid":{"rendered":"https:\/\/server.hk\/cnblog\/52283\/"},"modified":"2024-11-14T10:39:36","modified_gmt":"2024-11-14T02:39:36","slug":"ubuntu-%e4%b8%8b%e5%b8%b8%e7%94%a8%e5%bc%b7%e5%8c%96%e5%ad%b8%e7%bf%92%e5%af%a6%e9%a9%97%e7%92%b0%e5%a2%83%e6%90%ad%e5%bb%ba-mujoco-openai-gym-rllab-deepmind-lab-torcs-pysc2","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/52283\/","title":{"rendered":"Ubuntu \u4e0b\u5e38\u7528\u5f37\u5316\u5b78\u7fd2\u5be6\u9a57\u74b0\u5883\u642d\u5efa (MuJoCo, OpenAI Gym, rllab, DeepMind Lab, TORCS, PySC2)"},"content":{"rendered":"<h1 id=\"ubuntu-%e4%b8%8b%e5%b8%b8%e7%94%a8%e5%bc%b7%e5%8c%96%e5%ad%b8%e7%bf%92%e5%af%a6%e9%a9%97%e7%92%b0%e5%a2%83%e6%90%ad%e5%bb%ba-kUvXiQnNVG\">Ubuntu \u4e0b\u5e38\u7528\u5f37\u5316\u5b78\u7fd2\u5be6\u9a57\u74b0\u5883\u642d\u5efa<\/h1>\n<p>\u96a8\u8457\u4eba\u5de5\u667a\u6167\u7684\u8fc5\u901f\u767c\u5c55\uff0c\u5f37\u5316\u5b78\u7fd2\uff08Reinforcement Learning, RL\uff09\u6210\u70ba\u4e86\u7814\u7a76\u7684\u71b1\u9ede\u4e4b\u4e00\u3002\u5f37\u5316\u5b78\u7fd2\u7684\u61c9\u7528\u7bc4\u570d\u5ee3\u6cdb\uff0c\u5f9e\u904a\u6232\u5230\u81ea\u52d5\u99d5\u99db\uff0c\u751a\u81f3\u662f\u6a5f\u5668\u4eba\u63a7\u5236\u7b49\u9818\u57df\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5728 Ubuntu \u7cfb\u7d71\u4e0b\u642d\u5efa\u5e7e\u500b\u5e38\u7528\u7684\u5f37\u5316\u5b78\u7fd2\u5be6\u9a57\u74b0\u5883\uff0c\u5305\u62ec MuJoCo\u3001OpenAI Gym\u3001rllab\u3001DeepMind Lab\u3001TORCS \u548c PySC2\u3002<\/p>\n<h2 id=\"1-mujoco-kUvXiQnNVG\">1. MuJoCo<\/h2>\n<p>MuJoCo\uff08Multi-Joint dynamics with Contact\uff09\u662f\u4e00\u500b\u9ad8\u6548\u7684\u7269\u7406\u5f15\u64ce\uff0c\u5c08\u70ba\u6a5f\u5668\u4eba\u5b78\u548c\u751f\u7269\u529b\u5b78\u7814\u7a76\u800c\u8a2d\u8a08\u3002\u5b83\u7684\u512a\u52e2\u5728\u65bc\u80fd\u5920\u6a21\u64ec\u8907\u96dc\u7684\u52d5\u614b\u7cfb\u7d71\uff0c\u4e26\u63d0\u4f9b\u9ad8\u6548\u7684\u8a08\u7b97\u6027\u80fd\u3002<\/p>\n<h3 id=\"%e5%ae%89%e8%a3%9d%e6%ad%a5%e9%a9%9f-kUvXiQnNVG\">\u5b89\u88dd\u6b65\u9a5f<\/h3>\n<ul>\n<li>\u9996\u5148\uff0c\u4e0b\u8f09 MuJoCo \u7684\u5b89\u88dd\u5305\uff0c\u4e26\u89e3\u58d3\u5230\u6307\u5b9a\u76ee\u9304\u3002<\/li>\n<li>\u63a5\u8457\uff0c\u8a2d\u7f6e\u74b0\u5883\u8b8a\u91cf\uff1a<\/li>\n<pre><code>export MUJOCO_PY_MUJOCO_PATH=\/path\/to\/mujoco\nexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:\/path\/to\/mujoco\/bin<\/code><\/pre>\n<li>\u6700\u5f8c\uff0c\u5b89\u88dd MuJoCo \u7684 Python \u63a5\u53e3\uff1a<\/li>\n<pre><code>pip install mujoco-py<\/code><\/pre>\n<\/ul>\n<h2 id=\"2-openai-gym-kUvXiQnNVG\">2. OpenAI Gym<\/h2>\n<p>OpenAI Gym \u662f\u4e00\u500b\u958b\u6e90\u7684\u5f37\u5316\u5b78\u7fd2\u5e73\u53f0\uff0c\u63d0\u4f9b\u4e86\u591a\u7a2e\u74b0\u5883\u4f9b\u7814\u7a76\u8005\u548c\u958b\u767c\u8005\u4f7f\u7528\u3002\u5b83\u7684\u8a2d\u8a08\u7c21\u55ae\u6613\u7528\uff0c\u9069\u5408\u5feb\u901f\u5be6\u9a57\u548c\u6e2c\u8a66\u3002<\/p>\n<h3 id=\"%e5%ae%89%e8%a3%9d%e6%ad%a5%e9%a9%9f-kUvXiQnNVG\">\u5b89\u88dd\u6b65\u9a5f<\/h3>\n<ul>\n<li>\u4f7f\u7528 pip \u5b89\u88dd OpenAI Gym\uff1a<\/li>\n<pre><code>pip install gym<\/code><\/pre>\n<li>\u5982\u679c\u9700\u8981\u984d\u5916\u7684\u74b0\u5883\uff0c\u53ef\u4ee5\u5b89\u88dd\u76f8\u61c9\u7684\u5305\uff0c\u4f8b\u5982\uff1a<\/li>\n<pre><code>pip install gym[atari]<\/code><\/pre>\n<\/ul>\n<h2 id=\"3-rllab-kUvXiQnNVG\">3. rllab<\/h2>\n<p>rllab \u662f\u4e00\u500b\u7531 Berkeley \u63d0\u51fa\u7684\u5f37\u5316\u5b78\u7fd2\u6846\u67b6\uff0c\u5c08\u6ce8\u65bc\u5be6\u9a57\u7684\u53ef\u91cd\u73fe\u6027\u548c\u53ef\u64f4\u5c55\u6027\u3002\u5b83\u652f\u6301\u591a\u7a2e\u5f37\u5316\u5b78\u7fd2\u7b97\u6cd5\uff0c\u4e26\u63d0\u4f9b\u4e86\u8c50\u5bcc\u7684\u5be6\u9a57\u5de5\u5177\u3002<\/p>\n<h3 id=\"%e5%ae%89%e8%a3%9d%e6%ad%a5%e9%a9%9f-kUvXiQnNVG\">\u5b89\u88dd\u6b65\u9a5f<\/h3>\n<ul>\n<li>\u9996\u5148\uff0c\u514b\u9686 rllab \u7684 GitHub \u5009\u5eab\uff1a<\/li>\n<pre><code>git clone https:\/\/github.com\/rll\/rllab.git<\/code><\/pre>\n<li>\u7136\u5f8c\uff0c\u9032\u5165 rllab \u76ee\u9304\u4e26\u5b89\u88dd\u4f9d\u8cf4\uff1a<\/li>\n<pre><code>cd rllab\npip install -r requirements.txt<\/code><\/pre>\n<\/ul>\n<h2 id=\"4-deepmind-lab-kUvXiQnNVG\">4. DeepMind Lab<\/h2>\n<p>DeepMind Lab \u662f\u4e00\u500b 3D \u74b0\u5883\uff0c\u5c08\u70ba\u5f37\u5316\u5b78\u7fd2\u7814\u7a76\u800c\u8a2d\u8a08\u3002\u5b83\u63d0\u4f9b\u4e86\u8c50\u5bcc\u7684\u5834\u666f\u548c\u6311\u6230\uff0c\u9069\u5408\u7528\u65bc\u8a13\u7df4\u667a\u80fd\u9ad4\u3002<\/p>\n<h3 id=\"%e5%ae%89%e8%a3%9d%e6%ad%a5%e9%a9%9f-kUvXiQnNVG\">\u5b89\u88dd\u6b65\u9a5f<\/h3>\n<ul>\n<li>\u9996\u5148\uff0c\u514b\u9686 DeepMind Lab \u7684 GitHub \u5009\u5eab\uff1a<\/li>\n<pre><code>git clone https:\/\/github.com\/deepmind\/lab.git<\/code><\/pre>\n<li>\u7136\u5f8c\uff0c\u6839\u64da\u5b98\u65b9\u6587\u6a94\u9032\u884c\u5b89\u88dd\u548c\u914d\u7f6e\u3002<\/li>\n<\/ul>\n<h2 id=\"5-torcs-kUvXiQnNVG\">5. TORCS<\/h2>\n<p>TORCS\uff08The Open Racing Car Simulator\uff09\u662f\u4e00\u500b\u958b\u6e90\u7684\u8cfd\u8eca\u6a21\u64ec\u5668\uff0c\u9069\u5408\u7528\u65bc\u5f37\u5316\u5b78\u7fd2\u4e2d\u7684\u81ea\u52d5\u99d5\u99db\u7814\u7a76\u3002<\/p>\n<h3 id=\"%e5%ae%89%e8%a3%9d%e6%ad%a5%e9%a9%9f-kUvXiQnNVG\">\u5b89\u88dd\u6b65\u9a5f<\/h3>\n<ul>\n<li>\u9996\u5148\uff0c\u5b89\u88dd TORCS\uff1a<\/li>\n<pre><code>sudo apt-get install torcs<\/code><\/pre>\n<li>\u7136\u5f8c\uff0c\u6839\u64da\u9700\u8981\u914d\u7f6e\u74b0\u5883\u3002<\/li>\n<\/ul>\n<h2 id=\"6-pysc2-kUvXiQnNVG\">6. PySC2<\/h2>\n<p>PySC2 \u662f\u4e00\u500b\u57fa\u65bc StarCraft II \u7684\u5f37\u5316\u5b78\u7fd2\u74b0\u5883\uff0c\u9069\u5408\u7528\u65bc\u591a\u667a\u80fd\u9ad4\u7cfb\u7d71\u7684\u7814\u7a76\u3002<\/p>\n<h3 id=\"%e5%ae%89%e8%a3%9d%e6%ad%a5%e9%a9%9f-kUvXiQnNVG\">\u5b89\u88dd\u6b65\u9a5f<\/h3>\n<ul>\n<li>\u9996\u5148\uff0c\u5b89\u88dd StarCraft II \u5ba2\u6236\u7aef\uff0c\u7136\u5f8c\u514b\u9686 PySC2 \u5009\u5eab\uff1a<\/li>\n<pre><code>git clone https:\/\/github.com\/deepmind\/pysc2.git<\/code><\/pre>\n<li>\u63a5\u8457\uff0c\u5b89\u88dd\u4f9d\u8cf4\uff1a<\/li>\n<pre><code>pip install -r pysc2\/requirements.txt<\/code><\/pre>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-kUvXiQnNVG\">\u7e3d\u7d50<\/h2>\n<p>\u5728 Ubuntu \u7cfb\u7d71\u4e0b\u642d\u5efa\u5f37\u5316\u5b78\u7fd2\u5be6\u9a57\u74b0\u5883\u662f\u7814\u7a76\u548c\u958b\u767c\u7684\u91cd\u8981\u6b65\u9a5f\u3002\u7121\u8ad6\u662f MuJoCo\u3001OpenAI Gym \u9084\u662f\u5176\u4ed6\u74b0\u5883\uff0c\u90fd\u80fd\u70ba\u7814\u7a76\u8005\u63d0\u4f9b\u8c50\u5bcc\u7684\u8cc7\u6e90\u548c\u5de5\u5177\u3002\u9078\u64c7\u5408\u9069\u7684\u74b0\u5883\u53ef\u4ee5\u5e6b\u52a9\u60a8\u66f4\u6709\u6548\u5730\u9032\u884c\u5f37\u5316\u5b78\u7fd2\u7684\u5be6\u9a57\u548c\u958b\u767c\u3002\u5982\u679c\u60a8\u9700\u8981\u7a69\u5b9a\u7684\u4f3a\u670d\u5668\u4f86\u652f\u6301\u60a8\u7684\u5f37\u5316\u5b78\u7fd2\u9805\u76ee\uff0c\u8003\u616e\u4f7f\u7528\u6211\u5011\u7684<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u89e3\u6c7a\u65b9\u6848\uff0c\u70ba\u60a8\u7684\u7814\u7a76\u63d0\u4f9b\u5f37\u5927\u7684\u8a08\u7b97\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22\u5728Ubuntu\u4e0b\u642d\u5efa\u5e38\u7528\u5f37\u5316\u5b78\u7fd2\u5be6\u9a57\u74b0\u5883\u7684\u6307\u5357\uff0c\u5305\u62ecMuJoCo\u3001OpenAI Gym\u3001rllab\u3001DeepMind Lab\u3001TORCS\u548cPySC2\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-52283","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/52283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=52283"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/52283\/revisions"}],"predecessor-version":[{"id":52284,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/52283\/revisions\/52284"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=52283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=52283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=52283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}