RUCAIBox/TextBox

FileNotFoundError: [Errno 2] No such file or directory: 'saved/T5-xIntent_en2en-Jul-31-2021_ 13-45-46.pth'

puraminy opened this issue · 5 comments

When I try to call run_demo as this:

python run_demo.py --model=T5 --dataset=xInt
ent_en2en --pretrained_model_path=/drive2/pretrained/mt5/hf/mt5-small/ 

It gives the following error:

...mini/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line
 230, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/home/pouramini/miniconda3/lib/python3.7/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: 'saved/T5-xIntent_en2en-Jul-31-2021_
13-45-46.pth'

It searches for a file with current time (13-45) but my model exist in saved directory with another time, why it must matches the minutes and hours:

(base) pouramini@nlplab-server:~/TextBox/saved$ ls
GPT2-COCO-Jul-30-2021_21-51-08.pth  
T5-xIntent_en2en-Jul-31-2021_11-46-29.pth
RNN-COCO-Jul-30-2021_13-34-31.pth

Sorry, run_demo.py is used by the developer for debugging. And you can use run_textbox.py for training and evaluating models.

Thanks,
I have trained a model and it was saved in saved folder, then how can I use it for only evaluation on test data?

Use the following command:

python run_textbox.py --model=[xxx] --dataset=[yyy] --test_only=True --load_experiment=saved/[abc].pth

Thank you, hope you provide more documentation and models in your future versions!

OK, we will provide a detailed documentation and more models in the next version.
Thank you for your attention!