air_learning-ue4, rl环境配置踩坑及解决。

airlearning是一个做DRL的开发场景,集成了env setting,支持domain randomization。

一、 配置Air Learning Environment Generator

步骤:https://github.com/harvard-edge/airlearning-ue4

需要的环境为:

  1. Windows 10 System
  2. Unreal Engine 4.18.3
  3. Visual Studio Community 2017 (Version 15.7.1)
  4. Select Windows 8.1 SDK when installing Visual Studio

bug1:编译 AirSim的build.cmd时无法找到eigen3.3.2.zip

原因:build.cmd中的http://bitbucket.org/eigen/eigen/get/3.3.2.zip链接无法下载eigen3.3.2.zip

解决方法:手动下载

step1:在Eigen官网https://gitlab.com/libeigen/eigen/-/releases/3.3.2下载Eigen3.3.2.zip;

step2:  在AirSim-1\AirLib文件夹中创建deps文件夹,并将Eigen3.3.2.zip解压后的文件夹放入其中;

step3:去掉AirSim-1\build.cmd的第143-154行,并在其后添加以下代码:

powershell -command "& { Move-Item -Path AirLib\deps\eigen* -Destination AirLib\deps\del_eigen }"
REM move AirLib\deps\eigen* AirLib\deps\del_eigen
mkdir AirLib\deps\eigen3
move AirLib\deps\del_eigen\Eigen AirLib\deps\eigen3\Eigen
rmdir /S /Q AirLib\deps\del_eigen
del eigen3.zip
IF NOT EXIST AirLib\deps\eigen3 goto :buildfailed

bug2:编译 AirSim的build.cmd时half.h出错

d:\programdata\github\microsoft\airsim\airlib\deps\eigen3\eigen\src\core\arch\cuda\half.h : error C2220: 警告被视为错误 - 没有生成“object”文件 [D:\ProgramData\GitHub\Microsoft\AirSim\AirLib\AirLib.vcxproj]
d:\programdata\github\microsoft\airsim\airlib\deps\eigen3\eigen\src\core\arch\cuda\half.h : warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 [D:\ProgramData\GitHub\Microsoft\AirSim\AirLib\AirLib.vcxproj]

解决方法:

打开airsim\airlib\deps\eigen3\eigen\src\core\arch\cuda\half.h ,将其以 GB2312 编码方式保存(或者将其第16行的 AS IS 周围的中文双引号改为英文双引号),然后重新编译 AirSim 即可。

bug3:编译UE4工程(with or without airsim plugin)时UE4_4.18 or UE4_4.19不打开

问题描述:UE4_4.27可以打开,但无法进行编译,只能用UE4_4.18,但UE4_4.18 or UE4_4.19不打开。

原因:UE4Editor-XMPP.dll和UE4Editor-XMPP.出错。可以通过此电脑-管理-事件查看器-自定义视图-管理实践中找到出错原因如下。或者右键AirLearning.uproject,点击generate visual studio project files,用vs运行时也会显示UE4Editor-XMPP.dll和UE4Editor-XMPP.出错。

错误应用程序名称: UE4Editor.exe,版本: 4.18.3.0,时间戳: 0x5a5860ce
错误模块名称: UE4Editor-HTTP.dll,版本: 4.18.3.0,时间戳: 0x5a585e93
异常代码: 0xc0000005
错误偏移量: 0x0000000000019a63
错误进程 ID: 0x5ee8
错误应用程序启动时间: 0x01d975d6a6171fe1
错误应用程序路径: E:\Epic Games\UE_4.18\Engine\Binaries\Win64\UE4Editor.exe
错误模块路径: E:\Epic Games\UE_4.18\Engine\Binaries\Win64\UE4Editor-HTTP.dll
报告 ID: 0cae1f66-5ef3-4334-ba5b-0413e5d3d62b
错误程序包全名: 
错误程序包相对应用程序 ID: 

解决方法:将Epic Games\UE_4.27对应目录下的UE4Editor-XMPP.dll文件复制到Epic Games\UE_4.18对应目录下。

二、配置Air Learning Reinforcement Learning

harvard-edge/airlearning-rl: Reinforcement learning algorithms for Algorithm, policy exploration in Air Learning (github.com)

bug1:运行collect_data.py时reset()报错:

Traceback (most recent call last):
  File "F:\air_learning\airlearning-rl\run_time\collect_data.py", line 104, in 
    main()
  File "F:\air_learning\airlearning-rl\run_time\collect_data.py", line 100, in main
    runTask(task_el)
  File "F:\air_learning\airlearning-rl\run_time\collect_data.py", line 49, in runTask
    train_class.train(train_obj, env)
  File "F:\air_learning\airlearning-rl/algorithms/discrete/dqn\dqn_airsim.py", line 171, in train
    dqn.fit(env, callbacks=callbacks, nb_steps=settings.training_steps_cap, nb_max_episode_steps=settings.nb_max_episodes_steps,  visualize=False, verbose=0, log_interval=settings.logging_interval)
  File "E:\Anaconda\envs\airlearning\lib\site-packages\rl\core.py", line 132, in fit
    observation = deepcopy(env.reset())
  File "E:\Anaconda\envs\airlearning\lib\site-packages\gym\wrappers\order_enforcing.py", line 16, in reset
    return self.env.reset(**kwargs)
  File "E:\Anaconda\envs\airlearning\lib\site-packages\gym\core.py", line 74, in reset
    raise NotImplementedError
NotImplementedError

Process finished with exit code 1

解决方法:将airlearning-rl\gym_airsim\envs\AirGym.py中的def _reset(self):改为def reset(self):


你可能感兴趣的:(ue4)