TheLastBen
commited on
Commit
•
edc3150
1
Parent(s):
b4d3981
Update Scripts/mainpaperspacev2.py
Browse files- Scripts/mainpaperspacev2.py +13 -1
Scripts/mainpaperspacev2.py
CHANGED
@@ -321,6 +321,11 @@ def done():
|
|
321 |
|
322 |
def uplder(Remove_existing_instance_images, Crop_images, Crop_size, IMAGES_FOLDER_OPTIONAL, INSTANCE_DIR, CAPTIONS_DIR, ren):
|
323 |
|
|
|
|
|
|
|
|
|
|
|
324 |
uploader = widgets.FileUpload(description="Choose images",accept='image/*', multiple=True)
|
325 |
Upload = widgets.Button(
|
326 |
description='Upload',
|
@@ -516,6 +521,13 @@ def caption(CAPTIONS_DIR, INSTANCE_DIR):
|
|
516 |
|
517 |
def dbtrainv2(Resume_Training, UNet_Training_Steps, UNet_Learning_Rate, Text_Encoder_Training_Steps, Text_Encoder_Concept_Training_Steps, Text_Encoder_Learning_Rate, Style_Training, Resolution, MODEL_NAMEv2, SESSION_DIR, INSTANCE_DIR, CONCEPT_DIR, CAPTIONS_DIR, External_Captions, INSTANCE_NAME, Session_Name, OUTPUT_DIR, PT, resumev2, Save_Checkpoint_Every_n_Steps, Start_saving_from_the_step, Save_Checkpoint_Every):
|
518 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
519 |
if resumev2 and not Resume_Training:
|
520 |
print('[1;31mOverwrite your previously trained model ?, answering "yes" will train a new model, answering "no" will resumev2 the training of the previous model? yes or no ?[0m')
|
521 |
while True:
|
@@ -571,7 +583,7 @@ def dbtrainv2(Resume_Training, UNet_Training_Steps, UNet_Learning_Rate, Text_Enc
|
|
571 |
Enable_Text_Encoder_Concept_Training= True
|
572 |
|
573 |
|
574 |
-
if Text_Encoder_Training_Steps==0
|
575 |
Enable_text_encoder_training= False
|
576 |
else:
|
577 |
stptxt=Text_Encoder_Training_Steps
|
|
|
321 |
|
322 |
def uplder(Remove_existing_instance_images, Crop_images, Crop_size, IMAGES_FOLDER_OPTIONAL, INSTANCE_DIR, CAPTIONS_DIR, ren):
|
323 |
|
324 |
+
if os.path.exists(INSTANCE_DIR+"/.ipynb_checkpoints"):
|
325 |
+
call('rm -r '+INSTANCE_DIR+'/.ipynb_checkpoints', shell=True)
|
326 |
+
if os.path.exists(CONCEPT_DIR+"/.ipynb_checkpoints"):
|
327 |
+
call('rm -r '+CONCEPT_DIR+'/.ipynb_checkpoints', shell=True)
|
328 |
+
|
329 |
uploader = widgets.FileUpload(description="Choose images",accept='image/*', multiple=True)
|
330 |
Upload = widgets.Button(
|
331 |
description='Upload',
|
|
|
521 |
|
522 |
def dbtrainv2(Resume_Training, UNet_Training_Steps, UNet_Learning_Rate, Text_Encoder_Training_Steps, Text_Encoder_Concept_Training_Steps, Text_Encoder_Learning_Rate, Style_Training, Resolution, MODEL_NAMEv2, SESSION_DIR, INSTANCE_DIR, CONCEPT_DIR, CAPTIONS_DIR, External_Captions, INSTANCE_NAME, Session_Name, OUTPUT_DIR, PT, resumev2, Save_Checkpoint_Every_n_Steps, Start_saving_from_the_step, Save_Checkpoint_Every):
|
523 |
|
524 |
+
if os.path.exists(INSTANCE_DIR+"/.ipynb_checkpoints"):
|
525 |
+
call('rm -r '+INSTANCE_DIR+'/.ipynb_checkpoints', shell=True)
|
526 |
+
if os.path.exists(CONCEPT_DIR+"/.ipynb_checkpoints"):
|
527 |
+
call('rm -r '+CONCEPT_DIR+'/.ipynb_checkpoints', shell=True)
|
528 |
+
if os.path.exists(CAPTIONS_DIR+"/.ipynb_checkpoints"):
|
529 |
+
call('rm -r '+CAPTIONS_DIR+'/.ipynb_checkpoints', shell=True)
|
530 |
+
|
531 |
if resumev2 and not Resume_Training:
|
532 |
print('[1;31mOverwrite your previously trained model ?, answering "yes" will train a new model, answering "no" will resumev2 the training of the previous model? yes or no ?[0m')
|
533 |
while True:
|
|
|
583 |
Enable_Text_Encoder_Concept_Training= True
|
584 |
|
585 |
|
586 |
+
if Text_Encoder_Training_Steps==0:
|
587 |
Enable_text_encoder_training= False
|
588 |
else:
|
589 |
stptxt=Text_Encoder_Training_Steps
|