CalledProcessError
Author: GrahamboJangles
Pull request: no
Labels: name: wontfix

I'm running 
```
python /content/transformers/examples/run_lm_finetuning.py \
    --output_dir=output \
    --model_type=gpt2 \
    --model_name_or_path=gpt2 \
    --do_train \
    --train_data_file=TRAIN_FILE \
    --do_eval \
    --eval_data_file=TEST_FILE
```
in my [Colab notebook](https://colab.research.google.com/drive/1T3fUHHWPAgWKEEITOKZJFGvNp9332RW3) and it returns this:
```
10/14/2019 03:30:53 - WARNING - __main__ -   Process rank: -1, device: cpu, n_gpu: 0, distributed training: False, 16-bits training: False
10/14/2019 03:30:53 - INFO - transformers.configuration_utils -   loading configuration file https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-config.json from cache at /root/.cache/torch/transformers/4be02c5697d91738003fb1685c9872f284166aa32e061576bbe6aaeb95649fcf.085d5f6a8e7812ea05ff0e6ed0645ab2e75d80387ad55c1ad9806ee70d272f80
10/14/2019 03:30:53 - INFO - transformers.configuration_utils -   Model config {
  "attn_pdrop": 0.1,
  "embd_pdrop": 0.1,
  "finetuning_task": null,
  "initializer_range": 0.02,
  "layer_norm_epsilon": 1e-05,
  "n_ctx": 1024,
  "n_embd": 768,
  "n_head": 12,
  "n_layer": 12,
  "n_positions": 1024,
  "num_labels": 1,
  "output_attentions": false,
  "output_hidden_states": false,
  "output_past": true,
  "pruned_heads": {},
  "resid_pdrop": 0.1,
  "summary_activation": null,
  "summary_first_dropout": 0.1,
  "summary_proj_to_labels": true,
  "summary_type": "cls_index",
  "summary_use_proj": true,
  "torchscript": false,
  "use_bfloat16": false,
  "vocab_size": 50257
}

10/14/2019 03:30:53 - INFO - transformers.tokenization_utils -   loading file https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-vocab.json from cache at /root/.cache/torch/transformers/f2808208f9bec2320371a9f5f891c184ae0b674ef866b79c58177067d15732dd.1512018be4ba4e8726e41b9145129dc30651ea4fec86aa61f4b9f40bf94eac71
10/14/2019 03:30:53 - INFO - transformers.tokenization_utils -   loading file https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-merges.txt from cache at /root/.cache/torch/transformers/d629f792e430b3c76a1291bb2766b0a047e36fae0588f9dbc1ae51decdff691b.70bec105b4158ed9a1747fea67a43f5dee97855c64d62b6ec3742f4cfdb5feda
10/14/2019 03:30:54 - INFO - transformers.modeling_utils -   loading weights file https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-pytorch_model.bin from cache at /root/.cache/torch/transformers/4295d67f022061768f4adc386234dbdb781c814c39662dd1662221c309962c55.778cf36f5c4e5d94c8cd9cefcf2a580c8643570eb327f0d4a1f007fab2acbdf1
10/14/2019 03:30:58 - INFO - __main__ -   Training/evaluation parameters Namespace(adam_epsilon=1e-08, block_size=1024, cache_dir='', config_name='', device=device(type='cpu'), do_eval=True, do_lower_case=False, do_train=True, eval_all_checkpoints=False, eval_data_file='TEST_FILE', evaluate_during_training=False, fp16=False, fp16_opt_level='O1', gradient_accumulation_steps=1, learning_rate=5e-05, local_rank=-1, logging_steps=50, max_grad_norm=1.0, max_steps=-1, mlm=False, mlm_probability=0.15, model_name_or_path='gpt2', model_type='gpt2', n_gpu=0, no_cuda=False, num_train_epochs=1.0, output_dir='output', overwrite_cache=False, overwrite_output_dir=False, per_gpu_eval_batch_size=4, per_gpu_train_batch_size=4, save_steps=50, save_total_limit=None, seed=42, server_ip='', server_port='', tokenizer_name='', train_data_file='TRAIN_FILE', warmup_steps=0, weight_decay=0.0)
Traceback (most recent call last):
  File "/content/transformers/examples/run_lm_finetuning.py", line 543, in <module>
    main()
  File "/content/transformers/examples/run_lm_finetuning.py", line 490, in main
    train_dataset = load_and_cache_examples(args, tokenizer, evaluate=False)
  File "/content/transformers/examples/run_lm_finetuning.py", line 102, in load_and_cache_examples
    dataset = TextDataset(tokenizer, file_path=args.eval_data_file if evaluate else args.train_data_file, block_size=args.block_size)
  File "/content/transformers/examples/run_lm_finetuning.py", line 67, in __init__
    assert os.path.isfile(file_path)
AssertionError
---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
<ipython-input-21-2156f3b9e4fc> in <module>()
----> 1 get_ipython().run_cell_magic('shell', '', 'cd /content/transformers\nexport TRAIN_FILE=/content/wikitext-103-raw/wiki.train.raw\nexport TEST_FILE=/content/wikitext-103-raw/wiki.test.raw\n \npython /content/transformers/examples/run_lm_finetuning.py \\\n    --output_dir=output \\\n    --model_type=gpt2 \\\n    --model_name_or_path=gpt2 \\\n    --do_train \\\n    --train_data_file=TRAIN_FILE \\\n    --do_eval \\\n    --eval_data_file=TEST_FILE')

2 frames
/usr/local/lib/python3.6/dist-packages/google/colab/_system_commands.py in check_returncode(self)
    136     if self.returncode:
    137       raise subprocess.CalledProcessError(
--> 138           returncode=self.returncode, cmd=self.args, output=self.output)
    139 
    140   def _repr_pretty_(self, p, cycle):  # pylint:disable=unused-argument

CalledProcessError: Command 'cd /content/transformers
export TRAIN_FILE=/content/wikitext-103-raw/wiki.train.raw
export TEST_FILE=/content/wikitext-103-raw/wiki.test.raw
 
python /content/transformers/examples/run_lm_finetuning.py \
    --output_dir=output \
    --model_type=gpt2 \
    --model_name_or_path=gpt2 \
    --do_train \
    --train_data_file=TRAIN_FILE \
    --do_eval \
    --eval_data_file=TEST_FILE' returned non-zero exit status 1.
```

Comments:
Hello, does this still crash if you replace `TRAIN_FILE` with `$TRAIN_FILE` and `TEST_FILE` with `$TEST_FILE` in your command ?

@LysandreJik - Yes, it does.
```
10/14/2019 16:55:10 - WARNING - __main__ -   Process rank: -1, device: cpu, n_gpu: 0, distributed training: False, 16-bits training: False
10/14/2019 16:55:10 - INFO - transformers.file_utils -   https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-config.json not found in cache or force_download set to True, downloading to /tmp/tmpi7g0lm6a
100% 176/176 [00:00<00:00, 131305.14B/s]
10/14/2019 16:55:10 - INFO - transformers.file_utils -   copying /tmp/tmpi7g0lm6a to cache at /root/.cache/torch/transformers/4be02c5697d91738003fb1685c9872f284166aa32e061576bbe6aaeb95649fcf.085d5f6a8e7812ea05ff0e6ed0645ab2e75d80387ad55c1ad9806ee70d272f80
10/14/2019 16:55:10 - INFO - transformers.file_utils -   creating metadata file for /root/.cache/torch/transformers/4be02c5697d91738003fb1685c9872f284166aa32e061576bbe6aaeb95649fcf.085d5f6a8e7812ea05ff0e6ed0645ab2e75d80387ad55c1ad9806ee70d272f80
10/14/2019 16:55:10 - INFO - transformers.file_utils -   removing temp file /tmp/tmpi7g0lm6a
10/14/2019 16:55:10 - INFO - transformers.configuration_utils -   loading configuration file https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-config.json from cache at /root/.cache/torch/transformers/4be02c5697d91738003fb1685c9872f284166aa32e061576bbe6aaeb95649fcf.085d5f6a8e7812ea05ff0e6ed0645ab2e75d80387ad55c1ad9806ee70d272f80
10/14/2019 16:55:10 - INFO - transformers.configuration_utils -   Model config {
  "attn_pdrop": 0.1,
  "embd_pdrop": 0.1,
  "finetuning_task": null,
  "initializer_range": 0.02,
  "layer_norm_epsilon": 1e-05,
  "n_ctx": 1024,
  "n_embd": 768,
  "n_head": 12,
  "n_layer": 12,
  "n_positions": 1024,
  "num_labels": 1,
  "output_attentions": false,
  "output_hidden_states": false,
  "output_past": true,
  "pruned_heads": {},
  "resid_pdrop": 0.1,
  "summary_activation": null,
  "summary_first_dropout": 0.1,
  "summary_proj_to_labels": true,
  "summary_type": "cls_index",
  "summary_use_proj": true,
  "torchscript": false,
  "use_bfloat16": false,
  "vocab_size": 50257
}

10/14/2019 16:55:11 - INFO - transformers.file_utils -   https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-vocab.json not found in cache or force_download set to True, downloading to /tmp/tmp103hb26e
100% 1042301/1042301 [00:00<00:00, 3111277.27B/s]
10/14/2019 16:55:11 - INFO - transformers.file_utils -   copying /tmp/tmp103hb26e to cache at /root/.cache/torch/transformers/f2808208f9bec2320371a9f5f891c184ae0b674ef866b79c58177067d15732dd.1512018be4ba4e8726e41b9145129dc30651ea4fec86aa61f4b9f40bf94eac71
10/14/2019 16:55:11 - INFO - transformers.file_utils -   creating metadata file for /root/.cache/torch/transformers/f2808208f9bec2320371a9f5f891c184ae0b674ef866b79c58177067d15732dd.1512018be4ba4e8726e41b9145129dc30651ea4fec86aa61f4b9f40bf94eac71
10/14/2019 16:55:11 - INFO - transformers.file_utils -   removing temp file /tmp/tmp103hb26e
10/14/2019 16:55:12 - INFO - transformers.file_utils -   https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-merges.txt not found in cache or force_download set to True, downloading to /tmp/tmpp3c_047z
100% 456318/456318 [00:00<00:00, 1830222.06B/s]
10/14/2019 16:55:12 - INFO - transformers.file_utils -   copying /tmp/tmpp3c_047z to cache at /root/.cache/torch/transformers/d629f792e430b3c76a1291bb2766b0a047e36fae0588f9dbc1ae51decdff691b.70bec105b4158ed9a1747fea67a43f5dee97855c64d62b6ec3742f4cfdb5feda
10/14/2019 16:55:12 - INFO - transformers.file_utils -   creating metadata file for /root/.cache/torch/transformers/d629f792e430b3c76a1291bb2766b0a047e36fae0588f9dbc1ae51decdff691b.70bec105b4158ed9a1747fea67a43f5dee97855c64d62b6ec3742f4cfdb5feda
10/14/2019 16:55:12 - INFO - transformers.file_utils -   removing temp file /tmp/tmpp3c_047z
10/14/2019 16:55:12 - INFO - transformers.tokenization_utils -   loading file https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-vocab.json from cache at /root/.cache/torch/transformers/f2808208f9bec2320371a9f5f891c184ae0b674ef866b79c58177067d15732dd.1512018be4ba4e8726e41b9145129dc30651ea4fec86aa61f4b9f40bf94eac71
10/14/2019 16:55:12 - INFO - transformers.tokenization_utils -   loading file https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-merges.txt from cache at /root/.cache/torch/transformers/d629f792e430b3c76a1291bb2766b0a047e36fae0588f9dbc1ae51decdff691b.70bec105b4158ed9a1747fea67a43f5dee97855c64d62b6ec3742f4cfdb5feda
10/14/2019 16:55:13 - INFO - transformers.file_utils -   https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-pytorch_model.bin not found in cache or force_download set to True, downloading to /tmp/tmpfgx0mkjn
100% 548118077/548118077 [00:15<00:00, 34424870.34B/s]
10/14/2019 16:55:29 - INFO - transformers.file_utils -   copying /tmp/tmpfgx0mkjn to cache at /root/.cache/torch/transformers/4295d67f022061768f4adc386234dbdb781c814c39662dd1662221c309962c55.778cf36f5c4e5d94c8cd9cefcf2a580c8643570eb327f0d4a1f007fab2acbdf1
10/14/2019 16:55:31 - INFO - transformers.file_utils -   creating metadata file for /root/.cache/torch/transformers/4295d67f022061768f4adc386234dbdb781c814c39662dd1662221c309962c55.778cf36f5c4e5d94c8cd9cefcf2a580c8643570eb327f0d4a1f007fab2acbdf1
10/14/2019 16:55:31 - INFO - transformers.file_utils -   removing temp file /tmp/tmpfgx0mkjn
10/14/2019 16:55:31 - INFO - transformers.modeling_utils -   loading weights file https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-pytorch_model.bin from cache at /root/.cache/torch/transformers/4295d67f022061768f4adc386234dbdb781c814c39662dd1662221c309962c55.778cf36f5c4e5d94c8cd9cefcf2a580c8643570eb327f0d4a1f007fab2acbdf1
10/14/2019 16:55:35 - INFO - __main__ -   Training/evaluation parameters Namespace(adam_epsilon=1e-08, block_size=1024, cache_dir='', config_name='', device=device(type='cpu'), do_eval=True, do_lower_case=False, do_train=True, eval_all_checkpoints=False, eval_data_file='/content/wikitext-103-raw/wiki.test.raw', evaluate_during_training=False, fp16=False, fp16_opt_level='O1', gradient_accumulation_steps=1, learning_rate=5e-05, local_rank=-1, logging_steps=50, max_grad_norm=1.0, max_steps=-1, mlm=False, mlm_probability=0.15, model_name_or_path='gpt2', model_type='gpt2', n_gpu=0, no_cuda=False, num_train_epochs=1.0, output_dir='output', overwrite_cache=False, overwrite_output_dir=False, per_gpu_eval_batch_size=4, per_gpu_train_batch_size=4, save_steps=50, save_total_limit=None, seed=42, server_ip='', server_port='', tokenizer_name='', train_data_file='/content/wikitext-103-raw/wiki.train.raw', warmup_steps=0, weight_decay=0.0)
10/14/2019 16:55:35 - INFO - __main__ -   Creating features from dataset file at /content/wikitext-103-raw
tcmalloc: large alloc 1081139200 bytes == 0x8b1a4000 @  0x7f2fddd0b1e7 0x50ca4f 0x50440b 0x504bff 0x52d7c2 0x59aa60 0x4f858d 0x4f98c7 0x4f6128 0x4f42e7 0x5a1481 0x57c57c 0x57e6ae 0x583d97 0x627fff 0x4f858d 0x4f98c7 0x4f6128 0x4f426e 0x5a1481 0x512a60 0x53ee21 0x57ec0c 0x4f88ba 0x4fa6c0 0x4f6128 0x4f7d60 0x4f876d 0x4fa6c0 0x4f6128 0x4f7d60
tcmalloc: large alloc 2162278400 bytes == 0xcb8b2000 @  0x7f2fddd0b1e7 0x50ca4f 0x50440b 0x504bff 0x52d7c2 0x59aa60 0x4f858d 0x4f98c7 0x4f6128 0x4f42e7 0x5a1481 0x57c57c 0x57e6ae 0x583d97 0x627fff 0x4f858d 0x4f98c7 0x4f6128 0x4f426e 0x5a1481 0x512a60 0x53ee21 0x57ec0c 0x4f88ba 0x4fa6c0 0x4f6128 0x4f7d60 0x4f876d 0x4fa6c0 0x4f6128 0x4f7d60
tcmalloc: large alloc 2158272512 bytes == 0x14c6ce000 @  0x7f2fddd0b1e7 0x5bd1cb 0x583f51 0x627fff 0x4f858d 0x4f98c7 0x4f6128 0x4f426e 0x5a1481 0x512a60 0x53ee21 0x57ec0c 0x4f88ba 0x4fa6c0 0x4f6128 0x4f7d60 0x4f876d 0x4fa6c0 0x4f6128 0x4f7d60 0x4f876d 0x4f98c7 0x4f6128 0x4f9023 0x6415b2 0x64166a 0x643730 0x62b26e 0x4b4cb0 0x7f2fdd908b97 0x5bdf6a
tcmalloc: large alloc 2158272512 bytes == 0x6ae1c000 @  0x7f2fddd0b1e7 0x50ca4f 0x50de4a 0x58405c 0x627fff 0x4f858d 0x4f98c7 0x4f6128 0x4f426e 0x5a1481 0x512a60 0x53ee21 0x57ec0c 0x4f88ba 0x4fa6c0 0x4f6128 0x4f7d60 0x4f876d 0x4fa6c0 0x4f6128 0x4f7d60 0x4f876d 0x4f98c7 0x4f6128 0x4f9023 0x6415b2 0x64166a 0x643730 0x62b26e 0x4b4cb0 0x7f2fdd908b97
tcmalloc: large alloc 2158272512 bytes == 0xeb866000 @  0x7f2fddd0b1e7 0x50ca4f 0x50de4a 0x5aebf9 0x4f858d 0x4f98c7 0x4f6128 0x4f7d60 0x4f876d 0x4f98c7 0x4f6128 0x4f7d60 0x4f876d 0x4f98c7 0x4f6128 0x4f7d60 0x4f876d 0x4f98c7 0x4f6128 0x4f426e 0x5a1481 0x512a60 0x53ee21 0x57ec0c 0x4f88ba 0x4fa6c0 0x4f6128 0x4f7d60 0x4f876d 0x4fa6c0 0x4f6128
---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
<ipython-input-5-cbb21af32de2> in <module>()
----> 1 get_ipython().run_cell_magic('shell', '', 'cd /content/transformers\nexport TRAIN_FILE=/content/wikitext-103-raw/wiki.train.raw\nexport TEST_FILE=/content/wikitext-103-raw/wiki.test.raw\n \npython /content/transformers/examples/run_lm_finetuning.py \\\n    --output_dir=output \\\n    --model_type=gpt2 \\\n    --model_name_or_path=gpt2 \\\n    --do_train \\\n    --train_data_file=$TRAIN_FILE \\\n    --do_eval \\\n    --eval_data_file=$TEST_FILE')

2 frames
/usr/local/lib/python3.6/dist-packages/google/colab/_system_commands.py in check_returncode(self)
    136     if self.returncode:
    137       raise subprocess.CalledProcessError(
--> 138           returncode=self.returncode, cmd=self.args, output=self.output)
    139 
    140   def _repr_pretty_(self, p, cycle):  # pylint:disable=unused-argument

CalledProcessError: Command 'cd /content/transformers
export TRAIN_FILE=/content/wikitext-103-raw/wiki.train.raw
export TEST_FILE=/content/wikitext-103-raw/wiki.test.raw
 
python /content/transformers/examples/run_lm_finetuning.py \
    --output_dir=output \
    --model_type=gpt2 \
    --model_name_or_path=gpt2 \
    --do_train \
    --train_data_file=$TRAIN_FILE \
    --do_eval \
    --eval_data_file=$TEST_FILE' died with <Signals.SIGKILL: 9>.
```
I've tried: with GPU, without GPU, TPU. All have the same error.

I currently face the same issue

I have the same problem:
Im running on GoogleColab:
!python run_language_modeling.py \
    --output_dir=output \
    --model_type=gpt2 \
    --model_name_or_path=gpt2 \
    --do_train \
    --train_data_file="../../drive/My Drive/HuggingFace/train.txt" \
    --per_gpu_train_batch_size=1 

And I get this:

`03/03/2020 06:46:34 - INFO - __main__ -   Creating features from dataset file at ../../drive/My Drive/HuggingFace
tcmalloc: large alloc 1684217856 bytes == 0x14e26c000 @  0x7f80cc4a21e7 0x5450df 0x52e319 0x52f3cf 0x53e701 0x4f2b30 0x50a8af 0x50c5b9 0x508245 0x5096b7 0x595311 0x5a522c 0x5a670a 0x4bb19c 0x5bd993 0x50a8af 0x50c5b9 0x508245 0x509642 0x595311 0x54a6ff 0x551b81 0x5aa6ec 0x50abb3 0x50d390 0x508245 0x50a080 0x50aa7d 0x50d390 0x508245 0x50a080
tcmalloc: large alloc 3368435712 bytes == 0x7f7f0339c000 @  0x7f80cc4a21e7 0x5450df 0x52e319 0x52f3cf 0x53e701 0x4f2b30 0x50a8af 0x50c5b9 0x508245 0x5096b7 0x595311 0x5a522c 0x5a670a 0x4bb19c 0x5bd993 0x50a8af 0x50c5b9 0x508245 0x509642 0x595311 0x54a6ff 0x551b81 0x5aa6ec 0x50abb3 0x50d390 0x508245 0x50a080 0x50aa7d 0x50d390 0x508245 0x50a080
tcmalloc: large alloc 3344367616 bytes == 0x7f7e3be2c000 @  0x7f80cc4a21e7 0x5ad4cb 0x4bb356 0x5bd993 0x50a8af 0x50c5b9 0x508245 0x509642 0x595311 0x54a6ff 0x551b81 0x5aa6ec 0x50abb3 0x50d390 0x508245 0x50a080 0x50aa7d 0x50d390 0x508245 0x50a080 0x50aa7d 0x50c5b9 0x508245 0x50b403 0x635222 0x6352d7 0x638a8f 0x639631 0x4b0f40 0x7f80cc09fb97 0x5b2fda
tcmalloc: large alloc 3343319040 bytes == 0x7f7f0339c000 @  0x7f80cc4a21e7 0x5450df 0x5464ca 0x4bb455 0x5bd993 0x50a8af 0x50c5b9 0x508245 0x509642 0x595311 0x54a6ff 0x551b81 0x5aa6ec 0x50abb3 0x50d390 0x508245 0x50a080 0x50aa7d 0x50d390 0x508245 0x50a080 0x50aa7d 0x50c5b9 0x508245 0x50b403 0x635222 0x6352d7 0x638a8f 0x639631 0x4b0f40 0x7f80cc09fb97
tcmalloc: large alloc 3343319040 bytes == 0x7f7e3be2c000 @  0x7f80cc4a21e7 0x5450df 0x5464ca 0x536c89 0x50a8af 0x50c5b9 0x508245 0x50a080 0x50aa7d 0x50c5b9 0x508245 0x50a080 0x50aa7d 0x50c5b9 0x508245 0x509642 0x595311 0x54a6ff 0x551b81 0x5aa6ec 0x50abb3 0x50d390 0x508245 0x50a080 0x50aa7d 0x50d390 0x508245 0x50a080 0x50aa7d 0x50c5b9 0x508245
tcmalloc: large alloc 3343319040 bytes == 0x7f7e3be2c000 @  0x7f80cc4a21e7 0x5450df 0x5464ca 0x536808 0x50a8af 0x50c5b9 0x508245 0x50a080 0x50aa7d 0x50c5b9 0x508245 0x50a080 0x50aa7d 0x50c5b9 0x508245 0x50a080 0x50aa7d 0x50c5b9 0x508245 0x509642 0x595311 0x54a6ff 0x551b81 0x5aa6ec 0x50abb3 0x50d390 0x508245 0x50a080 0x50aa7d 0x50d390 0x508245
^C`

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.


I still get this problem. Are there any updates?

I also got this issue! Are there any updates?