Run the Dockerfile with the http basic authentication added in mlflow tracking server. Check out how to use it in the blog below.
blog - https://visionhong.github.io/aws/AWS-MLflow-SD-LoRA/
export MLFLOW_TRACKING_URI="<ECS 태스크 Public IP>"
export MLFLOW_TRACKING_USERNAME="<대시보드 username>"
export MLFLOW_TRACKING_PASSWORD="<대시보드 비밀번호>"
export AWS_ACCESS_KEY_ID="<IAM 사용자 Access Key>"
export AWS_SECRET_ACCESS_KEY="<IAM 사용자 Secret Key>"
python train_tune.py \
--pretrained_model_name_or_path="stabilityai/stable-diffusion-2-1-base" \
--dataset_name="zoheb/sketch-scene" \
--dataloader_num_workers=8 \
--width=256 --height=256 --center_crop --random_flip \
--train_batch_size=1 \
--gradient_accumulation_steps=4 \
--max_train_steps=1000 \
--learning_rate=1e-04 \
--lr_scheduler="cosine" --lr_warmup_steps=0 \
--experiments_name='sketch_ray_tune' \
--seed=1337 \
--mixed_precision='fp16' \
--enable_xformers_memory_efficient_attention \
--tune \
--gpus_per_trial=1
result:
![mlflow-res2](https://private-user-images.githubusercontent.com/53398821/244397029-1a1eb055-0f94-49d0-9278-a3dae98d2713.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIzOTkzMDgsIm5iZiI6MTcyMjM5OTAwOCwicGF0aCI6Ii81MzM5ODgyMS8yNDQzOTcwMjktMWExZWIwNTUtMGY5NC00OWQwLTkyNzgtYTNkYWU5OGQyNzEzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzMxVDA0MTAwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVmOTEwNTczMDQzNGI0Y2E3OWEzZDZkZjcxYWM2ZTU0MzUzZjE1MDEwNjU2ZjhiM2RjMzE2NDFkYWQ4MGMwNzEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.YeYFEIQMWOqArCZE7zqBCv8cZ6wVIP5_Rt30VsS0PVY)
![mlflow-res1](https://private-user-images.githubusercontent.com/53398821/244396999-84c38ca5-4768-46c0-96ad-50b531c129bf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIzOTkzMDgsIm5iZiI6MTcyMjM5OTAwOCwicGF0aCI6Ii81MzM5ODgyMS8yNDQzOTY5OTktODRjMzhjYTUtNDc2OC00NmMwLTk2YWQtNTBiNTMxYzEyOWJmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzMxVDA0MTAwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZlYzIzMjYzN2MzNzRkOWMyZDM1YWJlM2UzYzQwMDgxZTEzNGE1YzBiODkxOWI5ZjE5NTI1YWIyOTE1M2NmZDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.jxM5YMZ-W0vn-ZyPrPEEQBsFuL_nwJ6c9_Ys7Q90DEo)
accelerate launch --mixed_precision="fp16" train_tune.py \
--pretrained_model_name_or_path="stabilityai/stable-diffusion-2-1-base" \
--dataset_name="zoheb/sketch-scene" \
--dataloader_num_workers=8 \
--width=256 --height=256 --center_crop --random_flip \
--train_batch_size=2 \
--gradient_accumulation_steps=4 \
--num_train_epochs=10 \
--learning_rate=1e-03 \
--lr_scheduler="cosine" --lr_warmup_steps=500 \
--output_dir="LoRA_sketch_output" \
--experiments_name='sketch' \
--checkpointing_steps=5000 \
--validation_prompt="a man swimming in the sea" \
--validation_epochs=1 \
--num_validation_images=2 \
--seed=1337 \
--enable_xformers_memory_efficient_attention
result:
![mlflow-loss](https://private-user-images.githubusercontent.com/53398821/244397960-c105a27c-185d-40c8-89d8-5817e88e48a6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIzOTkzMDgsIm5iZiI6MTcyMjM5OTAwOCwicGF0aCI6Ii81MzM5ODgyMS8yNDQzOTc5NjAtYzEwNWEyN2MtMTg1ZC00MGM4LTg5ZDgtNTgxN2U4OGU0OGE2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzMxVDA0MTAwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThiMjg5MzBiZjIzODc2OGFjOTJiNzIwZjkxN2MwYWJmZTViYTY3NzE2MDIwNWJjNDcxOWJmODg0ODY0NGU0ODEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.734K6LjAQlj5QdNJ0bg1nfKjhFXvoWw_e8T8oHSBfr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