guillaumegenthial / tf_ner

Simple and Efficient Tensorflow implementations of NER models with tf.estimator and tf.data
Apache License 2.0
923 stars 275 forks source link

Why i got estimator error? I do not change any code. #43

Closed wgh1992 closed 5 years ago

wgh1992 commented 5 years ago

runfile('D:/coding/jupyter workplace/tf_ner-master/models/lstm_crf/main.py', wdir='D:/coding/jupyter workplace/tf_ner-master/models/lstm_crf') Using config: {'_model_dir': 'results/model', '_tf_random_seed': None, '_save_summary_steps': 100, '_save_checkpoints_steps': None, '_save_checkpoints_secs': 120, '_session_config': allow_soft_placement: true graph_options { rewrite_options { meta_optimizer_iterations: ONE } } , '_keep_checkpoint_max': 5, '_keep_checkpoint_every_n_hours': 10000, '_log_step_count_steps': 100, '_train_distribute': None, '_device_fn': None, '_protocol': None, '_eval_distribute': None, '_experimental_distribute': None, '_service': None, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x000001698906BD30>, '_task_type': 'worker', '_task_id': 0, '_global_id_in_cluster': 0, '_master': '', '_evaluation_master': '', '_is_chief': True, '_num_ps_replicas': 0, '_num_worker_replicas': 1} Traceback (most recent call last):

File "", line 1, in runfile('D:/coding/jupyter workplace/tf_ner-master/models/lstm_crf/main.py', wdir='D:/coding/jupyter workplace/tf_ner-master/models/lstm_crf')

File "D:\ComputerSoftwares\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 786, in runfile execfile(filename, namespace)

File "D:\ComputerSoftwares\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "D:/coding/jupyter workplace/tf_ner-master/models/lstm_crf/main.py", line 173, in estimator, 'f1', 500, min_steps=8000, run_every_secs=120)

File "D:\ComputerSoftwares\Anaconda\lib\site-packages\tensorflow_estimator\contrib\estimator\python\estimator\early_stopping.py", line 266, in stop_if_no_increase_hook run_every_steps=run_every_steps)

File "D:\ComputerSoftwares\Anaconda\lib\site-packages\tensorflow_estimator\contrib\estimator\python\estimator\early_stopping.py", line 422, in _stop_if_no_metric_improvement_hook run_every_steps=run_every_steps)

File "D:\ComputerSoftwares\Anaconda\lib\site-packages\tensorflow_estimator\contrib\estimator\python\estimator\early_stopping.py", line 88, in make_early_stopping_hook 'Got: {}'.format(type(estimator)))

TypeError: estimator must have type tf.estimator.Estimator. Got: <class 'tensorflow.python.estimator.estimator.Estimator'>

wgh1992 commented 5 years ago

solve it