Skip to content

About Path(args.output_dir).mkdir(exist_ok=True) in inference_tokenizer.py #7

Description

@llstela

I tried the evaluation with the following error.

python3 scripts/inference_tokenizer.py --image assets/ILSVRC2012_val_00010240.png --checkpoint preset/one-d-piece_l256/pytorch_model.bin
attention mode is flash
Loading model model...
Working on device: cuda
Traceback (most recent call last):
File "/home/notebook/code/personal/S9059210/one_d_token/One-D-Piece/scripts/inference_tokenizer.py", line 98, in
main(args)
File "/home/notebook/code/personal/S9059210/one_d_token/One-D-Piece/scripts/inference_tokenizer.py", line 77, in main
Path(args.output_dir).mkdir(exist_ok=True)
File "/opt/conda/envs/1d-piece/lib/python3.10/pathlib.py", line 1175, in mkdir
self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: 'generated/one_d_piece'

By replacing Path(args.output_dir).mkdir(exist_ok=True) with os.makedirs(args.output_dir, exist_ok=True) can solve the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions