bert icon indicating copy to clipboard operation
bert copied to clipboard

extract_features.py failed to load trained model

Open ycremar opened this issue 8 years ago • 1 comments

Hi, When I run the extract_features.py to extract fixed features, there are warnings like: WARNING:tensorflow:Using temporary folder as model directory: /tmp/tmp6b6n4e9y INFO:tensorflow:Could not find trained model in model_dir: /tmp/tmp6b6n4e9y, running initialization to predict. Do that mean the trained model was not loaded? I'm sure that I was using the correct path to bert_model.ckpt because both vocab.txt and bert_config.json can be successfully loaded.

Below is the entire log:

INFO:tensorflow:*** Example *** INFO:tensorflow:unique_id: 0 INFO:tensorflow:tokens: [CLS] what is this photo taken looking through ? [SEP] INFO:tensorflow:input_ids: 101 2054 2003 2023 6302 2579 2559 2083 1029 102 0 0 0 0 0 0 INFO:tensorflow:input_mask: 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 INFO:tensorflow:input_type_ids: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 INFO:tensorflow:*** Example *** INFO:tensorflow:unique_id: 1 INFO:tensorflow:tokens: [CLS] what position is this man playing ? [SEP] INFO:tensorflow:input_ids: 101 2054 2597 2003 2023 2158 2652 1029 102 0 0 0 0 0 0 0 INFO:tensorflow:input_mask: 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 INFO:tensorflow:input_type_ids: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 INFO:tensorflow:*** Example *** INFO:tensorflow:unique_id: 2 INFO:tensorflow:tokens: [CLS] what color is the players shirt ? [SEP] INFO:tensorflow:input_ids: 101 2054 3609 2003 1996 2867 3797 1029 102 0 0 0 0 0 0 0 INFO:tensorflow:input_mask: 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 INFO:tensorflow:input_type_ids: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 INFO:tensorflow:*** Example *** INFO:tensorflow:unique_id: 3 INFO:tensorflow:tokens: [CLS] is this man a professional baseball player ? [SEP] INFO:tensorflow:input_ids: 101 2003 2023 2158 1037 2658 3598 2447 1029 102 0 0 0 0 0 0 INFO:tensorflow:input_mask: 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 INFO:tensorflow:input_type_ids: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 INFO:tensorflow:*** Example *** INFO:tensorflow:unique_id: 4 INFO:tensorflow:tokens: [CLS] what color is the snow ? [SEP] INFO:tensorflow:input_ids: 101 2054 3609 2003 1996 4586 1029 102 0 0 0 0 0 0 0 0 INFO:tensorflow:input_mask: 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 INFO:tensorflow:input_type_ids: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 WARNING:tensorflow:Estimator's model_fn (<function model_fn_builder..model_fn at 0x7f3d1aeb1158>) includes params argument, but params are not passed to Estimator. WARNING:tensorflow:Using temporary folder as model directory: /tmp/tmp6b6n4e9y INFO:tensorflow:Using config: {'_model_dir': '/tmp/tmp6b6n4e9y', '_tf_random_seed': None, '_save_summary_steps': 100, '_save_checkpoints_steps': None, '_save_checkpoints_secs': 600, '_session_config': None, '_keep_checkpoint_max': 5, '_keep_checkpoint_every_n_hours': 10000, '_log_step_count_steps': None, '_train_distribute': None, '_device_fn': None, '_service': None, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7f3d1aeb66d8>, '_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, '_tpu_config': TPUConfig(iterations_per_loop=2, num_shards=8, num_cores_per_replica=None, per_host_input_for_training=3, tpu_job_name=None, initial_infeed_sleep_secs=None), '_cluster': None} INFO:tensorflow:_TPUContext: eval_on_tpu True WARNING:tensorflow:eval_on_tpu ignored because use_tpu is False. INFO:tensorflow:Could not find trained model in model_dir: /tmp/tmp6b6n4e9y, running initialization to predict. INFO:tensorflow:Calling model_fn. INFO:tensorflow:Running infer on CPU INFO:tensorflow:Done calling model_fn. INFO:tensorflow:Graph was finalized. 2018-11-07 09:03:11.547931: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 AVX512F FMA 2018-11-07 09:03:11.982904: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1405] Found device 0 with properties: name: GeForce GTX 1080 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.582 pciBusID: 0000:41:00.0 totalMemory: 10.91GiB freeMemory: 10.75GiB 2018-11-07 09:03:11.982946: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1484] Adding visible gpu devices: 0 2018-11-07 09:03:12.359383: I tensorflow/core/common_runtime/gpu/gpu_device.cc:965] Device interconnect StreamExecutor with strength 1 edge matrix: 2018-11-07 09:03:12.359441: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0 2018-11-07 09:03:12.359465: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] 0: N 2018-11-07 09:03:12.359867: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1097] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 10398 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:41:00.0, compute capability: 6.1) INFO:tensorflow:Running local_init_op. INFO:tensorflow:Done running local_init_op. ^C

Thanks!

ycremar avatar Nov 07 '18 17:11 ycremar

That's warning is expected, I'll add something about it in the README.

jacobdevlin-google avatar Nov 07 '18 18:11 jacobdevlin-google