Unity3d 为什么要团结';s ML代理不与Google Colab合作

Unity3d 为什么要团结';s ML代理不与Google Colab合作,unity3d,google-colaboratory,reinforcement-learning,ml-agent,Unity3d,Google Colaboratory,Reinforcement Learning,Ml Agent,我试图在GoogleColab上训练ML代理,但每次都失败了,并且出现了相同的错误 WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/compat/v2_compat.py:65: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be r

我试图在GoogleColab上训练ML代理,但每次都失败了,并且出现了相同的错误

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/compat/v2_compat.py:65: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term


                        ▄▄▄▓▓▓▓
                   ╓▓▓▓▓▓▓█▓▓▓▓▓
              ,▄▄▄m▀▀▀'  ,▓▓▓▀▓▓▄                           ▓▓▓  ▓▓▌
            ▄▓▓▓▀'      ▄▓▓▀  ▓▓▓      ▄▄     ▄▄ ,▄▄ ▄▄▄▄   ,▄▄ ▄▓▓▌▄ ▄▄▄    ,▄▄
          ▄▓▓▓▀        ▄▓▓▀   ▐▓▓▌     ▓▓▌   ▐▓▓ ▐▓▓▓▀▀▀▓▓▌ ▓▓▓ ▀▓▓▌▀ ^▓▓▌  ╒▓▓▌
        ▄▓▓▓▓▓▄▄▄▄▄▄▄▄▓▓▓      ▓▀      ▓▓▌   ▐▓▓ ▐▓▓    ▓▓▓ ▓▓▓  ▓▓▌   ▐▓▓▄ ▓▓▌
        ▀▓▓▓▓▀▀▀▀▀▀▀▀▀▀▓▓▄     ▓▓      ▓▓▌   ▐▓▓ ▐▓▓    ▓▓▓ ▓▓▓  ▓▓▌    ▐▓▓▐▓▓
          ^█▓▓▓        ▀▓▓▄   ▐▓▓▌     ▓▓▓▓▄▓▓▓▓ ▐▓▓    ▓▓▓ ▓▓▓  ▓▓▓▄    ▓▓▓▓`
            '▀▓▓▓▄      ^▓▓▓  ▓▓▓       └▀▀▀▀ ▀▀ ^▀▀    `▀▀ `▀▀   '▀▀    ▐▓▓▌
               ▀▀▀▀▓▄▄▄   ▓▓▓▓▓▓,                                      ▓▓▓▓▀
                   `▀█▓▓▓▓▓▓▓▓▓▌
                        ¬`▀▀▀█▓

        
 Version information:
  ml-agents: 0.15.1,
  ml-agents-envs: 0.15.1,
  Communicator API: 0.15.0,
  TensorFlow: 2.0.2
Found path: /content/build/test/ball.x86_64
Mono path[0] = '/content/build/test/ball_Data/Managed'
Mono config path = '/content/build/test/ball_Data/MonoBleedingEdge/etc'
Preloaded 'lib_burst_generated.so'
Preloaded 'libgrpc_csharp_ext.x64.so'
Initialize engine version: 2018.4.21f1 (fd3915227633)
Forcing GfxDevice: Null
GfxDevice: creating device client; threaded=0
NullGfxDevice:
    Version:  NULL 1.0 [1.0]
    Renderer: Null Device
    Vendor:   Unity Technologies
Begin MonoManager ReloadAssembly
- Completed reload, in  0.147 seconds
WARNING: Shader Unsupported: 'Autodesk Interactive' - Pass 'FORWARD' has no vertex shader
WARNING: Shader Unsupported: 'Autodesk Interactive' - Pass 'FORWARD_DELTA' has no vertex shader
WARNING: Shader Unsupported: 'Autodesk Interactive' - Pass 'ShadowCaster' has no vertex shader
WARNING: Shader Unsupported: 'Autodesk Interactive' - All passes removed
UnloadTime: 1.492000 ms
Fallback handler could not load library /content/build/test/ball_Data/Mono/libcoreclr.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libcoreclr.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libcoreclr.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libSystem.dylib
Fallback handler could not load library /content/build/test/ball_Data/Mono/libSystem.dylib.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libSystem.dylib
Fallback handler could not load library /content/build/test/ball_Data/Mono/libcoreclr.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libcoreclr.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libcoreclr.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libSystem.dylib
Fallback handler could not load library /content/build/test/ball_Data/Mono/libSystem.dylib.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libSystem.dylib
2020-05-29 13:53:12 INFO [environment.py:160] Connected to Unity environment with package version 0.15.1-preview and communication version 0.15.0
2020-05-29 13:53:12 INFO [environment.py:305] Connected new brain:
3DBall?team=0
2020-05-29 13:53:12 INFO [trainer_controller.py:167] Hyperparameters for the PPOTrainer of brain 3DBall: 
    trainer:    ppo
    ... (Hyperparameter list)
    summary_path:   test-1_3DBall
    model_path: ./models/test-1/3DBall
    keep_checkpoints:   5
2020-05-29 13:53:12.718558: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-05-29 13:53:12.732085: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2200000000 Hz
2020-05-29 13:53:12.732627: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1818f40 executing computations on platform Host. Devices:
2020-05-29 13:53:12.732677: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): Host, Default Version
Receiving unhandled NULL exception
2020-05-29 13:54:17 INFO [subprocess_env_manager.py:150] UnityEnvironment worker 0: environment stopping.
2020-05-29 13:54:17 INFO [trainer_controller.py:104] Learning was interrupted. Please wait while the graph is generated.
2020-05-29 13:54:17 INFO [environment.py:455] Environment shut down with return code -11 (SIGSEGV).
2020-05-29 13:54:18 INFO [trainer_controller.py:100] Saved Model
2020-05-29 13:54:18 INFO [model_serialization.py:222] List of nodes to export for brain :3DBall?team=0
2020-05-29 13:54:18 INFO [model_serialization.py:224]   is_continuous_control
2020-05-29 13:54:18 INFO [model_serialization.py:224]   version_number
2020-05-29 13:54:18 INFO [model_serialization.py:224]   memory_size
2020-05-29 13:54:18 INFO [model_serialization.py:224]   action_output_shape
2020-05-29 13:54:18 INFO [model_serialization.py:224]   action
2020-05-29 13:54:18 INFO [model_serialization.py:224]   action_probs
Converting ./models/test-1/3DBall/frozen_graph_def.pb to ./models/test-1/3DBall.nn
IGNORED: Cast unknown layer
IGNORED: Shape unknown layer
IGNORED: StopGradient unknown layer
GLOBALS: 'is_continuous_control', 'version_number', 'memory_size', 'action_output_shape'
IN: 'vector_observation': [-1, 1, 1, 8] => 'sub_2'
OUT: 'action', 'action_probs'
DONE: wrote ./models/test-1/3DBall.nn file.
2020-05-29 13:54:18 INFO [model_serialization.py:76] Exported ./models/test-1/3DBall.nn file
ML代理版本=0.15.1

Unity版本=2018.4.21f1(用于创建Linux版本)

使用的步骤:

  • 从Unity Editor创建Linux的构建文件
  • 压缩构建文件并将其上载到google colab
  • 在google colab中解压缩并启用执行权限
  • 克隆并安装了ml代理repo
  • 使用此命令启动培训过程
  • 我遵循的另一种方法是:

    在google colab中安装unity以在colab本身中创建构建文件,但该构建在unity中不起作用

    为了实现这一点,我使用了

    互联网上似乎没有与此相关的资源。 所以,请帮助我让这个工作,我已经浪费了我的两天在搜索和试图运行谷歌colab的ML代理

    更新:
    colab笔记本在我使用Unity engine 2019.3.15f1版本更新了我的环境构建后开始工作。

    我遵循了这些链接,它对我起了作用,因此任何寻求完整实现的人都可以查看以下内容:

    GitHub回购:


    中级文章:

    我认为不可能运行exe文件。它需要显示一个窗口,我没有尝试过,但当你使用openai环境渲染时,它说没有屏幕异常。你应该在你的电脑上使用它。为了更快地训练,只需尽可能多地制作代理。我使用的文件是.x86_64,我想我们可以使用xvfb在colab上运行它(是的,当然.exe文件不会在google colab上运行,所以这就是为什么它需要一个Linux独立版本来构建unity环境)@jean françois fabre请不要删除这个答案,或者提供一个有效的解释。
    ENV_BINARY = '/content/build/test/ball.x86_64'
    
    mlagents-learn /content/config.yaml --run-id=test-1 --env=$ENV_BINARY --train --no-graphics