浏览代码

Add clearer message for bad permissions (#2539)

/develop-gpu-test
GitHub 5 年前
当前提交
eaf8ca35
共有 1 个文件被更改,包括 14 次插入14 次删除
  1. 28
      ml-agents-envs/mlagents/envs/environment.py

28
ml-agents-envs/mlagents/envs/environment.py


logger.debug("This is the launch string {}".format(launch_string))
# Launch Unity environment
if not docker_training:
subprocess_args = [launch_string]
self.proc1 = subprocess.Popen(
[
launch_string,
"-nographics",
"-batchmode",
"--port",
str(self.port),
]
+ args
)
else:
self.proc1 = subprocess.Popen(
[launch_string, "--port", str(self.port)] + args
)
subprocess_args += ["-nographics", "-batchmode"]
subprocess_args += ["--port", str(self.port)]
subprocess_args += args
try:
self.proc1 = subprocess.Popen(subprocess_args)
except PermissionError as perm:
# This is likely due to missing read or execute permissions on file.
raise UnityEnvironmentException(
f"Error when trying to launch environment - make sure "
f"permissions are set correctly. For example "
f'"chmod -R 755 {launch_string}"'
) from perm
else:
"""
Comments for future maintenance:

正在加载...
取消
保存