kookmin-sw / 2019-cap1-2019_4

Flex Ads to implement advertising system in offline market
MIT License
10 stars 7 forks source link

EC2 환경에서 코드 실행시 발생하는 문제 #45

Closed aaa0265 closed 5 years ago

aaa0265 commented 5 years ago

python code를 EC2에서 실행하기 위해 수정하는 과정에서 발생하는 오류 해결하기

aaa0265 commented 5 years ago

RDS에 저장된 테이블을 사용하기 위해서는 RDS와의 연결이 필요한데 DB를 찾을 수 없다는 오류가 발생

스크린샷, 2019-05-01 22-01-06

aaa0265 commented 5 years ago

해결 방법

db = pymysql.connect(host="RDS 엔드포인트 ", port=3306, user="사용자이름", passwd="비밀번호",db="") -> 코드 중 RDS와 연결하기 위한 부분인데 이 찍힌 부분을 RDS의 이름이 아닌 RDS 속 데이터 베이스 목록들을 확인하고 그 중 내가 사용할 구체적인 데이터베이스를 적어야한다!

스크린샷, 2019-05-01 22-21-08 -> 네모 박스 안에 있는 데이터 베이스 목록 중에 내가 사용할 것을 골라 넣어줘야한다.

aaa0265 commented 5 years ago

코드 실행시 오래 걸리면서 packet_write_wait: Connection to port 22: Broken pipe 이런 오류가 발생

aaa0265 commented 5 years ago

네트워크 문제일 가능성이 있어서 backgroud에서 실행해보기!

Jisoo-Min commented 5 years ago

백그라운드에서 실행하는 방법 nohup python 실행할파일 &

출력결과는 nohup.out에서 확인가능

Jisoo-Min commented 5 years ago

위에 처럼 코드 실행했을 때 백그라우드에서 작업되는 내용이 정상적으로 되지않을경우 nohup python -u ./main.py > mylog.log & 처럼 하기!!! 프린트 등 실행결과가 log에 저장됨

aaa0265 commented 5 years ago

백그라운드에서 실행하는 방법을 통해 해결했습니다!! (train set 이후 작업들도 오류 없이 실행됨) 스크린샷, 2019-05-04 17-04-18

aaa0265 commented 5 years ago

usage

사용하는 데이터가 커서 사용중인 용량이 금방 채워져 코드가 진행하다 오류 발생

aaa0265 commented 5 years ago

Feature를 합치는 과정에서 메모리 오류 발생 스크린샷, 2019-05-11 15-06-49

Jisoo-Min commented 5 years ago

인스턴스 그냥 키우는게 낫겟다.! + xgboost 모델 thread지정하는 파라미터 추가하기

aaa0265 commented 5 years ago

EC2 환경에서 plot tree 출력하는 부분에서 오류 발생

aaa0265 commented 5 years ago

스크린샷, 2019-05-25 21-35-20 필요한 패키지를 설치했는데도 동일한 오류 발생

aaa0265 commented 5 years ago

앞서 올린 오류는 import matplotlib matplotlib.use('Agg') -> 이 두줄을 추가하여 해결 image

aaa0265 commented 5 years ago

다른 오류 발생 image

Jisoo-Min commented 5 years ago

끊이지않는오류야.? ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ

Jisoo-Min commented 5 years ago

오류 해결하였으므로 이슈닫음! 필요시 재오픈!!