Mac 빌드 환경파일 관련 안내 #13
curieuxjy
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
안녕하세요.
RL KR 운영진입니다.
챌린지 환경 RL Village의 Mac 빌드 파일관련 공지를 드립니다.
해당 환경을 실행하는데 어려움이 많다는 이슈가 올라오고 있고 운영진이 테스트해봤을때도 맥 빌드의 경우 환경을 실행하는 과정이 다른 빌드들에 비해 많이 까다로운 것을 확인했습니다.
이에 따라 아래와 같이 여러분이 맥 빌드 환경을 실행할 수 있도록 예시로 과정을 정리해보았습니다!
먼저 README.md에서 환경을 받아주세요!
환경 압축 파일을 받은 후 압축을 풀어줍니다.
다음의 random_agent.py 코드를 통해 해당 환경에서 드론 에이전트가 랜덤하게 행동하도록 해보겠습니다.
random_agent.zip
해당 환경을 받아서 압축을 풀고 random agent.py를 열어주세요.
해당 코드의 9번째 줄의 file_name에 환경의 경로를 입력해주시면 됩니다.
저는 mac.app을 random_agent.py와 동일한 폴더에 위치시켰으므로 ./mac으로 경로를 설정했습니다.
다음으로 random_agent 코드를 실행하시면 아래와 같은 메시지가 뜨는 것을 확인할 수 있습니다.
mlagents_envs.exception.UnityEnvironmentException: Error when trying to launch environment - make sure permissions are set correctly. For example "chmod -R 755 /Users/leonard.q/Desktop/drone/./mac.app/Contents/MacOS/DroneDelivery"
해당 예시에 나온 명령어를 터미널에 그대로 입력해줍니다. 본 예시 경우 명령어는 다음과 같습니다.
chmod -R 755 /Users/leonard.q/Desktop/drone/./mac.app/Contents/MacOS/DroneDelivery
이제 다시 random_agent.py를 실행하시면 아래와 같은 경고문이 뜨는 것을 확인할 수 있습니다.
이제 아래 그림과 같이 맥의 "시스템 환경 설정"의 "보안 및 정보 보호"를 들어가보시면 아래 쪽에 저희가 실행할 드론 환경이 차단된 것을 확인할 수 있습니다.
"확인 없이 열기"를 클릭하여 환경을 실행할 수 있도록 해줍니다.
한번 더 경고창이 뜨지만 그대로 열기를 눌러주면 환경이 실행되지만 아래 그림과 같이 푸른 화면만 나오는 것을 확인할 수 있습니다.
이는 환경에 대한 Parameters.json이 작성되어 있지 않아 환경 자체적으로 오류가 발생하기 때문입니다.
이 파일을 포함해서 환경을 배포해봤지만 이렇게 하면 파일이 손상되었다는 경고와 함께 파일이 실행되지 않는 것을 확인했습니다.
이제 직접 환경 내부에 Parameters.json 파일을 넣어주겠습니다.
먼저 아래 그림과 같이 환경 파일을 우클릭 하고 "패키지 내용 보기"를 클릭합니다.
그리고 아래 그림과 같이 Contents 폴더 안에 StreamingAssets 폴더를 만들어줍니다.
그리고 소스코드 편집기를 열어주어 다음의 코드를 입력한 후 Parameters.json으로 저장하고 이를 방금 만들어준 StreamingAssets 내부에 넣어줍니다.
{ "reward" : 100, "penalty" : -100, "distanceRewardScale": 1 }
이제 다시 random_agent.py 코드를 실행하면 환경이 잘 실행되어 드론이 움직이고 아래와 같이 10 에피소드에 대해 각 에피소드의 스코어가 출력되는 것을 확인할 수 있습니다!
여기까지 맥 빌드 환경 사용하기의 내용을 정리해봤습니다!
해당 내용을 진행하시면서 잘 안되시는 내용이나 문의 사항이 있으시면 언제든 댓글 부탁드립니다!
감사합니다!
Beta Was this translation helpful? Give feedback.
All reactions