Dreambooth: use warnings instead of logger in parse_args() (#1688)
Use warnings instead of logger in parse_args() logger requires an `Accelerator`.
This commit is contained in:
parent
8b7cb962a5
commit
784beee969
|
@ -3,6 +3,7 @@ import hashlib
|
||||||
import itertools
|
import itertools
|
||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
|
import warnings
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
|
@ -255,10 +256,11 @@ def parse_args(input_args=None):
|
||||||
if args.class_prompt is None:
|
if args.class_prompt is None:
|
||||||
raise ValueError("You must specify prompt for class images.")
|
raise ValueError("You must specify prompt for class images.")
|
||||||
else:
|
else:
|
||||||
|
# logger is not available yet
|
||||||
if args.class_data_dir is not None:
|
if args.class_data_dir is not None:
|
||||||
logger.warning("You need not use --class_data_dir without --with_prior_preservation.")
|
warnings.warn("You need not use --class_data_dir without --with_prior_preservation.")
|
||||||
if args.class_prompt is not None:
|
if args.class_prompt is not None:
|
||||||
logger.warning("You need not use --class_prompt without --with_prior_preservation.")
|
warnings.warn("You need not use --class_prompt without --with_prior_preservation.")
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue