[1차]

  1. Elastic IP설정
  • 실행 중인 인스턴스와 연결되지 않은 각 탄력적 IP 주소(인스턴스가 켜져있지 않을때)에 대해 시간당 0.005 USD(일 0.12USD) 탄력적 IP 주소 - Amazon Elastic Compute Cloud
  • ssh config 에서 host name을 Elastic IP 로 수정 (숫자 하나를 잘못 써서 접속하지 못하는 실수가 있었음)

 

2. AWS 접속

  • ssh gan_server -v
  • git clone https://github.com/NVlabs/stylegan2-ada-pytorch.git
  • docker build . (도커파일이 있는 위치에서 이미지 빌드. 뭔가 실행이 된 것 같지만 도커 사용은 다음을 기약하기로 … )
  • conda activate pytorch_latest_p37 : 대신에, AMI에서 제공하는 conda 환경 적용
  • touch requirements.txt 작성하여 vi 로 수정
  • pip install gdown (다음에는 requirements.txt 에 포함시킬 것)
  • gdown https://drive.google.com/uc?id=1lxs_eNx4iSbMzoS40yng_9tZL5ZaFIrb 훈련 데이터(zip) 다운로드
  • python train.py --outdir=../results --data=./zzalgun_dataset.zip --gpus=1 --mirror=1 --resume=ffhq256 --snap=1 --cfg=paper256

 

3. 결과 파일 확인

  • AWS 서버 상에 저장된 파일을 로컬로 복제하여 확인하는 작업 (from remote to local)
  • 보내기 전 AWS 상에서 파일 위치 확인: 터미널 새로운 탭에서 AWS 접속 (ssh gan_server) → 사용자 확인(who) → 옮길 파일 위치 확인
scp -r gan_server:results/00000-zzalgun_dataset-mirror-paper256-resumeffhq256 .
  • -r : recursive. 해당 디렉토리 아래의 디렉토리들과 파일들을 대상으로 함.
  • gan_server 의 results/00000-zzalgun_dataset-mirror-paper256-resumeffhq256 디렉토리의 요소들을 local인 현재 위치(.)로 복제하겠다.
  • scp [HOST]:[옮길 파일/폴더 위치] [Destination 위치]

 

 

[2차]

전략

VScode 에서 SSH 접속하여 tensorflow 1 개발환경 활성화. tmux 새 세션 시작. 훈련 데이터 zip 파일을 gdown 받아 압축 해제. git clone 후 run_training를 직접 수정(image_snapshot_ticks, network_snapshot_ticks, resume_kimg, dataset_args)하고 tfrecords 생성. 훈련 전에 tmux 윈도우 새로 띄워 tensorflow launch하기. 다른 윈도우로 가서 훈련 시작.

 

 

tensorboard

tmux 윈도우 새로 열어 tensorboard 실행

tensorboard --logdir=tensorboard_logs

'인공지능 > computer vision' 카테고리의 다른 글

GAN실험 - GANspace  (0) 2022.08.10
GAN실험 - model blending & projection  (0) 2022.08.10
GAN실험 - transfer learning  (0) 2022.08.10
GAN실험 - 이미지전처리  (0) 2022.08.10
GAN 실험(4) - latent encoding + layer swapping  (0) 2022.08.10
복사했습니다!