ncbi-nlp/bluebert

ValueError: model_dir should be non-empty.

ding-si-han opened this issue · 1 comments

While running the inference task using the following command on MedNLI, I encounterred the following issue displayed below. Have downloaded the BlueBERT-Base, Uncased, PubMed+MIMIC-III model for this inference. Kindly appreciate advice on this error and how to run the inference on a custom NLI example (ie from a .txt file)

Command
python bluebert/run_bluebert.py
--do_train=true
--do_eval=false
--do_predict=true
--task_name="mednli"
--vocab_file=$BlueBERT_DIR/vocab.txt
--bert_config_file=$BlueBERT_DIR/bert_config.json
--init_checkpoint=$BlueBERT_DIR/bert_model.ckpt
--num_train_epochs=10.0
--data_dir=$DATASET_DIR
--output_dir=$OUTPUT_DIR
--do_lower_case=true

Logs
Traceback (most recent call last):
File "bluebert/run_bluebert.py", line 912, in
tf.app.run()
File "/home/dingsihan/.local/lib/python3.6/site-packages/tensorflow_core/python/platform/app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "/home/dingsihan/.local/lib/python3.6/site-packages/absl/app.py", line 299, in run
_run_main(main, args)
File "/home/dingsihan/.local/lib/python3.6/site-packages/absl/app.py", line 250, in _run_main
sys.exit(main(argv))
File "bluebert/run_bluebert.py", line 762, in main
per_host_input_for_training=is_per_host))
File "/home/dingsihan/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/tpu/tpu_config.py", line 233, in init
super(RunConfig, self).init(**kwargs)
File "/home/dingsihan/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/run_config.py", line 538, in init
compat_internal.path_to_str(model_dir))
File "/home/dingsihan/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/run_config.py", line 944, in _get_model_dir
raise ValueError('model_dir should be non-empty.')
ValueError: model_dir should be non-empty.

Environment
Platform: Ubuntu 18.04
Tensorflow Version: 1.15.2

Please check if the variable $OUTPUT_DIR is an empty string.