Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the path error in finetune/make_captions.py #986

Merged
merged 3 commits into from
Dec 12, 2023

Conversation

CjangCjengh
Copy link
Contributor

After executing

os.chdir("finetune")

An additional .. is needed in front of the path for caption_weights

if not is_url(args.caption_weights):
    args.caption_weights = os.path.join("..", args.caption_weights)

@CjangCjengh CjangCjengh changed the base branch from main to dev December 6, 2023 01:49
@kohya-ss
Copy link
Owner

kohya-ss commented Dec 7, 2023

Thank you for this. It seems that an error may occur. I think it might be a good idea to check whether the path is absolute or relative.

@CjangCjengh
Copy link
Contributor Author

CjangCjengh commented Dec 7, 2023

Thank you for your advice. And I have changed it to

if not is_url(args.caption_weights) and not os.path.isfile(args.caption_weights):
    args.caption_weights = os.path.join("..", args.caption_weights)

@kohya-ss kohya-ss merged commit 3b6825d into kohya-ss:dev Dec 12, 2023
1 check passed
@kohya-ss
Copy link
Owner

Thank you for update. Sorry for the delay.

@zadokov
Copy link

zadokov commented Dec 29, 2023

@CjangCjengh @bmaltais
After merge - when trying BLIP Captioning I get the below log and captioning is aborted.

Current Working Directory is: C:\SD\kohya_ss
Traceback (most recent call last):
File "C:\SD\kohya_ss\finetune\make_captions.py", line 202, in
main(args)
File "C:\SD\kohya_ss\finetune\make_captions.py", line 79, in main
if not is_url(args.caption_weights) and not os.path.isfile(args.caption_weights):
NameError: name 'is_url' is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants