thunlp / KnowledgeablePromptTuning

kpt code
206 stars 21 forks source link

Getting RuntimeError: Parent directory ckpts does not exist. #24

Open heartsker opened 1 year ago

heartsker commented 1 year ago

I am running run_few_shot.sh from the repository with no changes

This error occurs every time. I tried to add the directory ckpts, but that didn't help

The error's stacktrace is the following:

Traceback (most recent call last):
  File "<path-to-repo>/KnowledgeablePromptTuning/fewshot.py", line 346, in <module>
    torch.save(prompt_model.state_dict(),f"ckpts/{this_run_unicode}.ckpt")
  File "/opt/homebrew/lib/python3.11/site-packages/torch/serialization.py", line 440, in save
    with _open_zipfile_writer(f) as opened_zipfile:
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/torch/serialization.py", line 315, in _open_zipfile_writer
    return container(name_or_buffer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/torch/serialization.py", line 288, in __init__
    super().__init__(torch._C.PyTorchFileWriter(str(name)))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Parent directory ckpts does not exist.