albert
albert copied to clipboard
TypeError: '<' not supported between instances of 'int' and 'NoneType' while only predicting, try to fix it, but not sure is it make sense
https://github.com/google-research/albert/blob/0c88e1e0cdab54593ec5c485c5e27a3bb16949ad/run_squad_v1.py#L463
As tittle, the issue happen when setting --do_train=False and --do_predict=true
The way I fix it is adding
num_train_steps = int(len(eval_examples) / FLAGS.predict_batch_size * FLAGS.num_train_epochs)
under the code eval_examples = squad_utils.read_squad_examples(input_file=FLAGS.predict_file, is_training=False)
but, I am not sure is it correct way (cause it seems do evaluate in the function, and will save the best checkpoint, which I think it looks more like "evaluate", not predicting)
train_examples = squad_utils.read_squad_examples( input_file=FLAGS.train_file, is_training=True) num_train_steps = int( len(train_examples) / FLAGS.train_batch_size * FLAGS.num_train_epochs) if FLAGS.do_train: num_warmup_steps = int(num_train_steps * FLAGS.warmup_proportion)
Referring to run_squad_v2.py, put num_train_steps outside.
Is this issue fixed now? I'd like to check it out