1

我正在尝试在 Google colab 上训练 ML-Agent,但每次失败时都会出现相同的给定错误。

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-Agents 版本 = 0.15.1检查 repo

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

使用的步骤:

  1. 从 Unity 编辑器为 Linux 创建一个构建文件。
  2. 压缩构建文件并将其上传到 google colab。
  3. 在 google colab 中解压并启用执行权限。
  4. 克隆并安装了 ml-agents 存储库。与上述回购相同
  5. 使用此命令开始训练过程
ENV_BINARY = '/content/build/test/ball.x86_64'

mlagents-learn /content/config.yaml --run-id=test-1 --env=$ENV_BINARY --train --no-graphics

我遵循的另一种方法:

在 google colab 中安装 unity 以在 colab 本身中创建构建文件,但构建无法统一运行。

为了实现这一点,我使用了笔记本

互联网上似乎没有与此主题相关的资源。所以请帮助我完成这项工作,我已经浪费了两天的时间来搜索并尝试在 google colab 中运行 ML-Agents。

更新:在我使用 Unity 引擎的 2019.3.15f1 版本更新我的环境构建后,colab notebook 开始工作。

4

1 回答 1

-1

我关注了这些链接,它对我有用,所以任何正在寻找完整实现的人都可以看看这些:

GitHub存储库: 使用 Google Colab 的 ML 代理

中篇文章: 使用 Google Colab 训练 ML-Agent

于 2020-12-28T03:41:18.307 回答