question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
StevenTang1998commented, Jul 31, 2021

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

1reaction
StevenTang1998commented, Jul 31, 2021

Use the following command:

python run_textbox.py --model=[xxx] --dataset=[yyy] --test_only=True --load_experiment=saved/[abc].pth
Read more comments on GitHub >

github_iconTop Results From Across the Web

FileNotFoundError: [Errno 2] No such file or directory [duplicate]
The error is telling you that there is no file of that name in the working directory.
Read more >
FileNotFoundError: [Errno 2] No such file or directory
The error "FileNotFoundError: [Errno 2] No such file or directory" is telling you that there is no file of that name in the...
Read more >
Python FileNotFoundError: [Errno 2] No such file or directory ...
The Python FileNotFoundError: [Errno 2] No such file or directory error is often raised by the os library. This error tells you that...
Read more >
How to fix FileNotFoundError Errno 2 no such file or directory
There are several reasons why the FileNotFoundError Errno 2 No such file or directory error can occur: 1. Misspelled filename.
Read more >
torch.load(path),FileNotFoundError: [Errno 2] No such file or ...
I download a model and try to use torch.load(path),but an error occurs, No such file or directory… how to solve the problem? FileNotFoundError:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found