Skip to content

Commit

Permalink
Site updated: 2024-01-06 14:55:03
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaibineric committed Jan 6, 2024
1 parent de89cc1 commit ad8665e
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 4 deletions.
38 changes: 35 additions & 3 deletions 2023/10/22/pymarl环境/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://gitee.com/lihaibineric/picgo/raw/master/pic/image-20231022153907123.png">
<meta property="og:image" content="https://gitee.com/lihaibineric/picgo/raw/master/pic/image-20231022153709693.png">
<meta property="og:image" content="https://gitee.com/lihaibineric/picgo/raw/master/pic/image-20240106145437351.png">
<meta property="og:image" content="https://gitee.com/lihaibineric/picgo/raw/master/pic/image-20240106145218372.png">
<meta property="article:published_time" content="2023-10-22T06:35:25.000Z">
<meta property="article:modified_time" content="2024-01-04T13:09:58.806Z">
<meta property="article:modified_time" content="2024-01-06T06:54:55.240Z">
<meta property="article:author" content="Haibin Li">
<meta property="article:tag" content="人工智能">
<meta property="article:tag" content="深度学习">
Expand Down Expand Up @@ -213,7 +215,7 @@
<span class="post-meta mr-2">
<i class="iconfont icon-chart"></i>

2k words
2.7k words

</span>

Expand All @@ -224,7 +226,7 @@



17 mins
23 mins

</span>

Expand Down Expand Up @@ -360,6 +362,36 @@ <h2 id="额外设置">额外设置</h2>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">vim torch/_tensor.py<br></code></pre></td></tr></table></figure>
<p>将757行的内容进行修改</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs python">-: self.numpy()<br>+: self.cpu().numpy()<br></code></pre></td></tr></table></figure>
<h2 id="谷歌足球环境">谷歌足球环境</h2>
<p>Google Research
Football:https://github.com/google-research/football</p>
<h4 id="安装linux依赖环境">安装Linux依赖环境</h4>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt-get install git cmake build-essential libgl1-mesa-dev libsdl2-dev \<br>libsdl2-image-dev libsdl2-ttf-dev libsdl2-gfx-dev libboost-all-dev \<br>libdirectfb-dev libst-dev mesa-utils xvfb x11vnc python3-pip<br><br>python3 -m pip install --upgrade pip setuptools psutil wheel<br></code></pre></td></tr></table></figure>
<p>这一步非常重要,必须合理安装相应的包。</p>
<h4 id="安装gfootball">安装GFootball</h4>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs python">python3 -m pip install gfootball<br></code></pre></td></tr></table></figure>
<p>或者用github的仓库来进行安装</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">git <span class="hljs-built_in">clone</span> https://github.com/google-research/football.git<br><span class="hljs-built_in">cd</span> football<br></code></pre></td></tr></table></figure>
<p>可以选择使用虚拟环境:</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">python3 -m venv football-env<br><span class="hljs-built_in">source</span> football-env/bin/activate<br></code></pre></td></tr></table></figure>
<p>安装依赖包</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">python3 -m pip install .<br></code></pre></td></tr></table></figure>
<h4 id="运行结果展示">运行结果展示:</h4>
<p><img src="https://gitee.com/lihaibineric/picgo/raw/master/pic/image-20240106145437351.png" srcset="/img/loading.gif" lazyload alt="谷歌足球结果展示" style="zoom:50%;" /></p>
<h4 id="遇到的问题">遇到的问题</h4>
<p>编译错误,缺少boost的包:</p>
<figure>
<img
src="https://gitee.com/lihaibineric/picgo/raw/master/pic/image-20240106145036965.png" srcset="/img/loading.gif" lazyload
alt="编译错误" />
<figcaption aria-hidden="true">编译错误</figcaption>
</figure>
<p>选择安装如下包:</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">conda install anaconda::py-boost<br></code></pre></td></tr></table></figure>
<p>第二个错误:</p>
<p><img src="https://gitee.com/lihaibineric/picgo/raw/master/pic/image-20240106145218372.png" srcset="/img/loading.gif" lazyload alt="错误二" style="zoom:67%;" /></p>
<p>解决方法:</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">export</span> LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libffi.so.7<br></code></pre></td></tr></table></figure>


</div>
Expand Down
Loading

0 comments on commit ad8665e

Please sign in to comment.