Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Nov05/27001982dcefb52e1aee6b987bdf96c4 to your computer and use it in GitHub Desktop.
Save Nov05/27001982dcefb52e1aee6b987bdf96c4 to your computer and use it in GitHub Desktop.
20240211 【error】stream unity alagents from colab to twitch

⚠️ error

mlagents_envs.exception.UnityEnvironmentException: Environment shut down with return code -6 (SIGABRT).
  • code
try:
    videoStreamer.start()
    run_id = "train-1"
    env_name = "/content/python/Banana_Linux/Banana.x86_64"
    !mlagents-learn "/content/python/banana.yaml" --run-id=$run_id --env=$env_name --force
    # !mlagents-learn "/content/python/trainer_config.yaml" --run-id=$run_id --env=$env_name --force
except Exception as e:
    print(e)
finally:
    videoStreamer.close()
  • cell output
------------------------------------------------------------------------------------------------------------------------
Video Streamer/Recorder started.
/usr/local/lib/python3.10/dist-packages/torch/cuda/__init__.py:138: UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 11020). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver. (Triggered internally at ../c10/cuda/CUDAFunctions.cpp:108.)
  return torch._C._cuda_getDeviceCount() > 0
/usr/local/lib/python3.10/dist-packages/torch/__init__.py:614: UserWarning: torch.set_default_tensor_type() is deprecated as of PyTorch 2.1, please use torch.set_default_dtype() and torch.set_default_device() as alternatives. (Triggered internally at ../torch/csrc/tensor/python_tensor.cpp:451.)
  _C._set_default_tensor_type(t)
[WARNING] 'encoding_size' was deprecated for RewardSignals. Please use network_settings.

            ┐  ╖
        ╓╖╬│╡  ││╬╖╖
    ╓╖╬│││││┘  ╬│││││╬╖
 ╖╬│││││╬╜        ╙╬│││││╖╖                               ╗╗╗
 ╬╬╬╬╖││╦╖        ╖╬││╗╣╣╣╬      ╟╣╣╬    ╟╣╣╣             ╜╜╜  ╟╣╣
 ╬╬╬╬╬╬╬╬╖│╬╖╖╓╬╪│╓╣╣╣╣╣╣╣╬      ╟╣╣╬    ╟╣╣╣ ╒╣╣╖╗╣╣╣╗   ╣╣╣ ╣╣╣╣╣╣ ╟╣╣╖   ╣╣╣
 ╬╬╬╬┐  ╙╬╬╬╬│╓╣╣╣╝╜  ╫╣╣╣╬      ╟╣╣╬    ╟╣╣╣ ╟╣╣╣╙ ╙╣╣╣  ╣╣╣ ╙╟╣╣╜╙  ╫╣╣  ╟╣╣
 ╬╬╬╬┐     ╙╬╬╣╣      ╫╣╣╣╬      ╟╣╣╬    ╟╣╣╣ ╟╣╣╬   ╣╣╣  ╣╣╣  ╟╣╣     ╣╣╣┌╣╣╜
 ╬╬╬╜       ╬╬╣╣      ╙╝╣╣╬      ╙╣╣╣╗╖╓╗╣╣╣╜ ╟╣╣╬   ╣╣╣  ╣╣╣  ╟╣╣╦╓    ╣╣╣╣╣
 ╙   ╓╦╖    ╬╬╣╣   ╓╗╗╖            ╙╝╣╣╣╣╝╜   ╘╝╝╜   ╝╝╝  ╝╝╝   ╙╣╣╣    ╟╣╣╣
   ╩╬╬╬╬╬╬╦╦╬╬╣╣╗╣╣╣╣╣╣╣╝                                             ╫╣╣╣╣
      ╙╬╬╬╬╬╬╬╣╣╣╣╣╣╝╜
          ╙╬╬╬╣╣╣╜
             ╙
        
 Version information:
  ml-agents: 1.0.0,
  ml-agents-envs: 1.0.0,
  Communicator API: 1.5.0,
  PyTorch: 2.1.0+cu121
[INFO] Learning was interrupted. Please wait while the graph is generated.
Traceback (most recent call last):
  File "/usr/local/bin/mlagents-learn", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/mlagents/trainers/learn.py", line 267, in main
    run_cli(parse_command_line())
  File "/usr/local/lib/python3.10/dist-packages/mlagents/trainers/learn.py", line 263, in run_cli
    run_training(run_seed, options, num_areas)
  File "/usr/local/lib/python3.10/dist-packages/mlagents/trainers/learn.py", line 137, in run_training
    tc.start_learning(env_manager)
  File "/usr/local/lib/python3.10/dist-packages/mlagents_envs/timers.py", line 305, in wrapped
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/mlagents/trainers/trainer_controller.py", line 197, in start_learning
    raise ex
  File "/usr/local/lib/python3.10/dist-packages/mlagents/trainers/trainer_controller.py", line 172, in start_learning
    self._reset_env(env_manager)
  File "/usr/local/lib/python3.10/dist-packages/mlagents_envs/timers.py", line 305, in wrapped
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/mlagents/trainers/trainer_controller.py", line 105, in _reset_env
    env_manager.reset(config=new_config)
  File "/usr/local/lib/python3.10/dist-packages/mlagents/trainers/env_manager.py", line 68, in reset
    self.first_step_infos = self._reset_env(config)
  File "/usr/local/lib/python3.10/dist-packages/mlagents/trainers/subprocess_env_manager.py", line 446, in _reset_env
    ew.previous_step = EnvironmentStep(ew.recv().payload, ew.worker_id, {}, {})
  File "/usr/local/lib/python3.10/dist-packages/mlagents/trainers/subprocess_env_manager.py", line 101, in recv
    raise env_exception
mlagents_envs.exception.UnityEnvironmentException: Environment shut down with return code -6 (SIGABRT).
------------------------------------------------------------------------------------------------------------------------
Video Streamer successfully closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment