PyTorch-StudioGAN
PyTorch-StudioGAN copied to clipboard
list index out of range(in utils.ckpt. load_StudioGAN_ckpts())
hi,
I found glob. glob (in utils.ckpt. load_StudioGAN_ckpts())returns an empty list, causing list index out of range to appear.
The reason is that the folder name contains special character '=', so you need to run glob.escape()
to get the file in the path normally.
I used
x = join(ckpt_dir, "model=G-{when}-weights-step=".format(when=when))
Gen_ckpt_path = glob.glob(glob.escape(x) + '*.pth')[0]
y = join(ckpt_dir, "model=D-{when}-weights-step=".format(when=when))
Dis_ckpt_path = glob.glob(glob.escape(y) + '*.pth')[0]
instead of
Gen_ckpt_path = glob.glob(join(ckpt_dir, "model=G-{when}-weights-step*.pth".format(when=when)))[0]
Dis_ckpt_path = glob.glob(join(ckpt_dir, "model=D-{when}-weights-step*.pth".format(when=when)))[0]
thank.
I will reflect this ASPA.
Thank you for your kind reporting.