microsoft / protein-sequence-models

Other
228 stars 28 forks source link

No such file or directory: 'examples/results/some_proteins_mifst/wt_mifst_mean.pt' #12

Closed wenyuhaokikika closed 1 year ago

wenyuhaokikika commented 2 years ago

when i run demo,it raise exception

~/code/protein-sequence-models » python scripts/extract_mif.py mifst examples/gb1s.csv \                               wenyuhao@x86_64-conda_cos6-linux-gnu
    examples/ \
    examples/results/some_proteins_mifst/ \
    repr --include mean per_tok
Loading model...
Loading data...
  0%|                                                                                                                                 | 0/3 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "scripts/extract_mif.py", line 78, in <module>
    torch.save(rep.mean(dim=0).detach().cpu(),
  File "/data/wenyuhao/anaconda3/envs/fastText/lib/python3.8/site-packages/torch/serialization.py", line 376, in save
    with _open_file_like(f, 'wb') as opened_file:
  File "/data/wenyuhao/anaconda3/envs/fastText/lib/python3.8/site-packages/torch/serialization.py", line 230, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/data/wenyuhao/anaconda3/envs/fastText/lib/python3.8/site-packages/torch/serialization.py", line 211, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'examples/results/some_proteins_mifst/wt_mifst_mean.pt'

please add:

if not os.path.exists(args.out_dir):
    os.mkdir(args.out_dir)

scripts/extract_mif.py 78line

yangkky commented 1 year ago

You need to manually make the directory where you want the result to go before you run the script. .