yoctta / XPaste

38 stars 4 forks source link

Bugs when using --resume in text2im.py #3

Closed Z-MU-Z closed 1 year ago

Z-MU-Z commented 1 year ago

if args.resume: old=os.listdir(PATH) cls_names=[j['name'] for j in target_class] for i in clsnames: try: =cv2.imread(os.path.join(PATH,f"{i}_{args.samples-1}.png")) cls_names.remove(i) print(f"skipping {i}") except:

"for i in cls_names" and "cls_names.remove(i)" will cause conflicts and incorrectly skipping some classes

yoctta commented 1 year ago

Thank you. Fixed it by "for i in old:"

Z-MU-Z commented 1 year ago

Hello! Recently I discovered other bugs that hinder the normal use of the --resume function: python

=cv2.imread(os.path.join(PATH,f"{i}{args.samples-1}.png"))

_=cv2.imread(os.path.join(PATH,f"{i}/00{args.samples-1}.png")) The path name here is wrong. Additionally, since json cannot resume, I still need to write a dedicated function to calculate the clip score.