Closed yoheigon closed 3 years ago
Hello yoheigon,
if I remember correctly visual observations are only supported when a (game-)window is rendered.
By using "no_graphics = true" you are explicitly telling unity NOT to render a game-window.
Can you try with "no_graphics=false" and see if that fixes your issue?
Hi @yoheigon
@Ihsees is correct in pointing out that no_graphics=True will prevent visual observations from being sent correctly. Please set this flag to False.
Thank you for the info. Seems we need e.g. Xvfb for no_graphics=False. Are there any options that we can get visual observation as e.g. an array without rendering to a game-window? We would like to run on docker images and can't set a window system.
You can use xvfb with ml-agents. See this forum post and github issue
Thank you for the info
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Describe the bug We are trying to use visual observation for training. Our env is base on this sample https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Learning-Environment-Create-New.md It worked for local training with unity editor but the env doesn't return appropriate observation via UnityToGymWrapper.
To Reproduce Steps to reproduce the behavior:
Add camera sensor on unity editor
Build a binary file
Create a gym env
channel = EnvironmentParametersChannel() channel.set_float_parameter("simulation_mode", 1.0) unity_env = UnityEnvironment('RollerBall.x86_64', no_graphics=True, side_channels=[channel], worker_id=15, additional_args=['-logFile', 'unity.log']) env = UnityToGymWrapper(unity_env, uint8_visual=True)
from PIL import Image import matplotlib.pyplot as plt import numpy as np %matplotlib inline state = env.reset() plt.imshow(state) plt.show()