Error when running run_generation.py
I tried to run this code:
python ./examples/run_generation.py --model_type=gpt2 --length=20 --model_name_or_path=gpt2

However I am getting the error below:

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\GPT2\\.cache\\torch\\transformers\\tmpy2recb0u' -> 'C:\\Users\\GPT2\\.cache\\torch\\transformers\\f2808208f9bec2320371a9f5f891c184ae0b674ef866b79c58177067d15732dd.1512018be4ba4e8726e41b9145129dc30651ea4fec86aa61f4b9f40bf94eac71'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./examples/run_generation.py", line 237, in <module>
    main()
  File "./examples/run_generation.py", line 200, in main
    tokenizer = tokenizer_class.from_pretrained(args.model_name_or_path)
  File "C:\gpt2\venv\lib\site-packages\transformers\tokenization_utils.py", line 309, in from_pretrained
    return cls._from_pretrained(*inputs, **kwargs)
  File "C:\gpt2\venv\lib\site-packages\transformers\tokenization_utils.py", line 415, in _from_pretrained
    raise EnvironmentError(msg)
OSError: Couldn't reach server at '{}' to download vocabulary files.


How do I get over this hump? Thanks


It seems to me that there is either another program that has a lock on the GPT-2 file or that you can't access our S3. Does the error still happen if you restart your machine?<|||||>yes. I restarted several times but the issue persist<|||||>Seems to be a file lock issue. Can't rename a file because it's being used.
See here:
https://github.com/huggingface/transformers/blob/f599623a99b808e3d5926d89cd13237457b9eeba/src/transformers/file_utils.py#L392
Related #2385<|||||>Ok this should be solved on master now that #2384 is merged