ubuntu22.04 安装Deepmimc 问题解析

论文:DeepMimic: Example-Guided Deep Reinforcement Learning of Physics-Based Character Skills

总共所需配置,以下会逐一安装

C++:

  • OpenGL >= 3.2

Python:

  • Python 3.6

Misc:

  • MPI

  • Linux: sudo apt install libopenmpi-dev

开始安装(进入anaconda环境):

或者创建新环境

conda create -n deepmimc python=3.6

1.Bullet2.88

Bullet 2.88

请注意,必须在MPI4Py之前安装Bullet2 ,build后面加 DUSE_DOUBLE_PRECISION=OFF.

./build_cmake_pybullet_double.sh -DUSE_DOUBLE_PRECISION=OFF
cd build_cmake
sudo make install

或者一键安装:

 sudo apt-get install libbullet-dev libbullet-extras-dev

2. Eigen3

Eigen

mkdir build_dir &&cd build_dir
cmake ..
make install

3. OpenGL

sudo apt-get update
sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev

4. Freeglut

Freeglut

cmake .
make 
sudo make install

5. Glew

Glew

sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev
make
sudo make install
make clean

6. 其他包安装

PyOpenGL

pip install PyOpenGL PyOpenGL_accelerate
pip install mpi4py
conda install PyOpenGL

Tensorflow

pip install tensorflow-gpu==1.13.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
conda install cudatoolkit=10.0 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/

主要參考:https://blog.csdn.net/a745233700/article/details/109377039

出现问题:参考:https://blog.csdn.net/qq_24815615

FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])

运行以下代码,对numpy降级

pip uninstall numpy
pip install numpy==1.16.4

测试GPU对安装的tensorflow是否可用

python
import tensorflow as tf
print(tf.test.is_gpu_available())

ctrl+z 退回

7. Swig

Swig

打开新的终端(在anaconda环境外运行)

sudo apt-get install g++
sudo apt-get install libpcre3 libpcre3-dev
tar -xzcf swig-xxxxx.tar.gz
cd swig-3.0.12
./configure
make 
sudo make install
vim ~/.bashrc

写入(i为插入,ESC、:wq退出):

SWIG_PATH=/usr/local/share/swig/3.0.12
PATH=$PATH:$SWIG_PATH

依赖:

sudo apt install libopenmpi-dev

8. Make我们下载下来的DeepMimic

  1. 首先安装clang++

sudo apt-get install clang llvm

查看版本

clang --version 

clang出现问题无法安装,类似依赖不匹配什么的报错:

参考换源方法:https://blog.csdn.net/weixin_43846270/article/details/103827644

注意!!!ubuntu版本,建议换源之前参考这篇文章:https://blog.csdn.net/WU2629409421perfect

  1. 打开你下载的Deepmic/DeepMimicCore   目录,更改Makefile文件

请根据自己目录文件更换

EIGEN_DIR = /usr/local/include/eigen3
BULLET_INC_DIR = /usr/local/include/bullet
PYTHON_INC = /home/shun/anaconda3/envs/depmic/include/python3.6m
PYTHON_LIB = /home/shun/anaconda3/envs/depmic/lib/ -lpython3.6m

若报错:

~/DeepMimic/DeepMimicCore$ make python swig -c++ -python DeepMimicCore.i clang++ -c -g -std=c++11 -O3 ......SceneHeadingAMPGetup.o -lGLEW -lGL -lGLU -lglut -lBulletDynamics -lBulletCollision -lLinearMath -lm -lstdc++ DeepMimicCore_wrap.o -o _DeepMimicCore.so -L/usr/lib/ -lpython3.6 -L -L -L clang: error: argument to '-L' is missing (expected 1 value) make: *** [Makefile:76: python] Error 1

请使用此文件代替你的Makefile文件

https://github.com/zhaolongkzz/DeepMimic_configuration/blob/master/DeepMimicCore/Makefile

在Deepmic/DeepMimicCore 下make

make python

测试一下:

cd ..
python DeepMimic.py --arg_file args/run_humanoid3d_spinkick_args.txt

本人最后的报错:

libGL error: failed to load driver: swrast 
freeglut (foo): Unable to create OpenGL 1.0 context (flags 0, profile 0) 
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request:  151 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  32
  Current serial number in output stream:  33

如果你是NVIDIA显卡,开启了X Server 就会出现

sudo apt-get install nvidia-prime
sudo prime-select nvidia

关机重启再次测试,好耶!运行成功,并且本人副显示屏黑屏问题也解决🌶!

其他小问题:

libstdc++.so.6: version ‘GLIBCXX_3.4.30‘ not found 

参考:https://blog.csdn.net/bohrium/article/details/126546521

最后吐槽,第一次写博客,Ubuntu输入法真的烦!每次切换页面就需要鼠标重新选择中文。

参考:

  1. https://github.com/xbpeng/DeepMimic

  1. https://github.com/zhaolongkzz/DeepMimic_configuration#2-bullet

  1. https://blog.csdn.net/qq_45288566/article

  1. https://blog.csdn.net/a745233700/article/details/109377039

  1. https://blog.csdn.net/qq_24815615

  1. https://blog.csdn.net/weixin_43846270/article/details/103827644

  1. https://blog.csdn.net/WU2629409421perfect

  1. https://blog.csdn.net/bohrium/article/details/126546521

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值