unicode
The general run_squad.py doesn't appear to work properly for python 2.7 because of the json  dumping  string vs unicode issues during the eval.  

python2.7 run_squad.py \
  --bert_model bert-base-uncased \
  --do_train \
  --do_predict \
  --do_lower_case \
  --train_file $SQUAD_DIR/train-v1.1.json \
  --predict_file $SQUAD_DIR/dev-v1.1.json \
  --train_batch_size 12 \
  --learning_rate 3e-5 \
  --num_train_epochs 2.0 \
  --max_seq_length 384 \
  --doc_stride 128 \
  --output_dir /pytorch-pretrained-BERT/tmp/debug_squad/



02/15/2019 04:55:17 - INFO - __main__ -   Writing predictions to: /pytorch-pretrained-BERT/tmp/debug_squad/predictions.json
02/15/2019 04:55:17 - INFO - __main__ -   Writing nbest to: /pytorch-pretrained-BERT/tmp/debug_squad/nbest_predictions.json
Traceback (most recent call last):
  File "run_squad.py", line 1077, in <module>
    main()
  File "run_squad.py", line 1073, in main
    args.version_2_with_negative, args.null_score_diff_threshold)
  File "run_squad.py", line 619, in write_predictions
    writer.write(json.dumps(all_predictions, indent=4) + "\n")
TypeError: write() argument 1 must be unicode, not str

Yes, the examples are not adapted for Python 2, only the library.
I don't plan to adapt or maintain them but feel free to submit a PR!<|||||>env: python2.7
line 662: writer.write(json.dumps(all_predictions, indent=4) + "\n")
change as :writer.write(json.dumps(all_predictions, indent=4).decode('utf-8') + "\n")