furkanbiten/GoodNews

FileNotFoundError: [Errno 2] No such file or directory: 'save/show_attend_tell/model.pth'

Closed this issue · 1 comments

For

(/scratch2/sjn/pyta) [jalal@goku GoodNews]$ python train.py --cnn_weight data/resnet152-b121ed2d.pth

I get

(/scratch2/sjn/pyta) [jalal@goku GoodNews]$ tmux attach

image 127420: PERSON_ and PERSON_ in GPE_ in GPE_
image 127431: PERSON_ left and PERSON_ in GPE_
image 127444: PERSON_ in GPE_
image 127447: PERSON_ in DATE_
image 127472: PERSON_ in GPE_ on DATE_
image 127497: PERSON_ a NORP_ NORP_ in GPE_ on DATE_
image 127535: PERSON_ in DATE_
image 127536: PERSON_ and PERSON_ in GPE_
image 127546: PERSON_ in GPE_ on DATE_
image 127584: PERSON_ a NORP_ leader of the ORG_ in GPE_
image 127596: A UNK UNK UNK UNK UNK
evaluating validation preformance... 5023/5000 (5.082450)
{'testlen': 31857, 'reflen': 75785, 'guess': [31857, 26857, 22238, 17619], 'correct': [10185, 2230, 512, 159]}
ratio: 0.42036022959688035
Bleu_1:  0.08051972435966352
Bleu_2:  0.04103438062512367
Bleu_3:  0.02137332258808613
Bleu_4:  0.012205189537708628
ROUGE_L: 0.1975560912228822
CIDEr:   0.1773307729244918
Traceback (most recent call last):
  File "train.py", line 280, in <module>
    train(opt)
  File "train.py", line 238, in train
    torch.save(model.state_dict(), checkpoint_path)
  File "/scratch2/sjn/pyta/lib/python3.7/site-packages/torch/serialization.py", line 361, in save
    with _open_file_like(f, 'wb') as opened_file:
  File "/scratch2/sjn/pyta/lib/python3.7/site-packages/torch/serialization.py", line 229, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/scratch2/sjn/pyta/lib/python3.7/site-packages/torch/serialization.py", line 210, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'save/show_attend_tell/model.pth'
Closing remaining open files:data/data_news_label.h5...done/scratch2/goodnewsdata/data_news_image.h5...done

I'll update here when I find a solution.

Creating the "show_attend_tell" folder inside the "save" folder fixed the problem.