input_fn_builder() got an unexpected keyword argument 'features'
When training the model, first error (missing argument outpit_file) was easy to solve (specified output_file = "output"). But afterwards, run_classifier.convert_examples_to_features() throws error about keyword 'features'. No hint how to solve this!
Strack trace:
INFO:tensorflow:guid: train-5
INFO:tensorflow:tokens: [CLS] the stock rose $ 2 . 11 , or about 11 percent , to close friday at $ 21 . 51 on the new york stock exchange . [SEP] pg & e corp . shares jumped $ 1 . 63 or 8 percent to $ 21 . 03 on the new york stock exchange on friday . [SEP]
INFO:tensorflow:input_ids: 101 1996 4518 3123 1002 1016 1012 2340 1010 2030 2055 2340 3867 1010 2000 2485 5958 2012 1002 2538 1012 4868 2006 1996 2047 2259 4518 3863 1012 102 18720 1004 1041 13058 1012 6661 5598 1002 1015 1012 6191 2030 1022 3867 2000 1002 2538 1012 6021 2006 1996 2047 2259 4518 3863 2006 5958 1012 102 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
INFO:tensorflow:input_mask: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
INFO:tensorflow:segment_ids: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
INFO:tensorflow:label: 1 (id = 1)
***** Started training at 2018-11-05 07:44:50.022688 *****
Num examples = 3668
Batch size = 32
INFO:tensorflow: Num steps = 343
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-8-c5a5fb94a015> in <module>()
10 seq_length=MAX_SEQ_LENGTH,
11 is_training=True,
---> 12 drop_remainder=True)
13 estimator.train(input_fn=train_input_fn, max_steps=num_train_steps)
14 print('***** Finished training at {} *****'.format(datetime.datetime.now()))
TypeError: input_fn_builder() got an unexpected keyword argument 'features'
Don't understand why the above error message complains about unexpected keyword, as features in the function signatures.
In bert/extract_features.py, line 100:
def input_fn_builder(features, seq_length):
I updated run_classifier.py to be file-based since otherwise it uses a lot of memory for large sets. But I realized that this would break the colab and also might break people's code, so the new code is under file_based_input_fn_builder and the old code is input_fn_builder (i.e., what it used to be).
So this should be fixed now.
The Colab is working again so this should be also, let me know if it's not!
thanks @jacobdevlin-google it works again!
@jacobdevlin-google can you add some example for prediction after the model evaluation?