noc-lab / clinical_concept_extraction

Clinical Concept Extraction with Contextual Word Embedding
MIT License
40 stars 24 forks source link

error in get_annotation(all_sentences, batch_size) #3

Open MoAbd opened 5 years ago

MoAbd commented 5 years ago

WARNING: Logging before flag parsing goes to stderr. W0714 15:30:27.634637 140453550819136 deprecation_wrapper.py:119] From /mnt/c/Users/m.elkasaby/Desktop/clinical_concept_extraction/clinical_concept_extraction/elmo_vector.py:17: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W0714 15:30:27.645177 140453550819136 deprecation_wrapper.py:119] From /mnt/c/Users/m.elkasaby/Desktop/clinical_concept_extraction/clinical_concept_extraction/bilm.py:744: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.

W0714 15:30:27.645867 140453550819136 deprecation_wrapper.py:119] From /mnt/c/Users/m.elkasaby/Desktop/clinical_concept_extraction/clinical_concept_extraction/bilm.py:801: The name tf.get_variable is deprecated. Please use tf.compat.v1.get_variable instead.

W0714 15:30:27.666563 140453550819136 deprecation_wrapper.py:119] From /mnt/c/Users/m.elkasaby/Desktop/clinical_concept_extraction/clinical_concept_extraction/bilm.py:846: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

W0714 15:30:27.668683 140453550819136 deprecation.py:506] From /home/mo/miniconda2/envs/py36/lib/python3.6/site-packages/tensorflow/python/util/dispatch.py:180: calling squeeze (from tensorflow.python.ops.array_ops) with squeeze_dims is deprecated and will be removed in a future version. Instructions for updating: Use the axis argument instead W0714 15:30:28.030699 140453550819136 deprecation.py:323] From /mnt/c/Users/m.elkasaby/Desktop/clinical_concept_extraction/clinical_concept_extraction/bilm.py:990: LSTMCell.init (from tensorflow.python.ops.rnn_cell_impl) is deprecated and will be removed in a future version. Instructions for updating: This class is equivalent as tf.keras.layers.LSTMCell, and will be replaced by that in Tensorflow 2.0. W0714 15:30:28.042493 140453550819136 deprecation_wrapper.py:119] From /mnt/c/Users/m.elkasaby/Desktop/clinical_concept_extraction/clinical_concept_extraction/bilm.py:1034: The name tf.nn.rnn_cell.LSTMStateTuple is deprecated. Please use tf.compat.v1.nn.rnn_cell.LSTMStateTuple instead.

W0714 15:30:28.043191 140453550819136 deprecation.py:323] From /mnt/c/Users/m.elkasaby/Desktop/clinical_concept_extraction/clinical_concept_extraction/bilm.py:1035: dynamic_rnn (from tensorflow.python.ops.rnn) is deprecated and will be removed in a future version. Instructions for updating: Please use keras.layers.RNN(cell), which is equivalent to this API W0714 15:30:28.092082 140453550819136 deprecation.py:506] From /home/mo/miniconda2/envs/py36/lib/python3.6/site-packages/tensorflow/python/ops/init_ops.py:1251: calling VarianceScaling.init (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version. Instructions for updating: Call initializer instance with the dtype argument instead of passing it to the constructor W0714 15:30:28.844484 140453550819136 deprecation.py:506] From /home/mo/miniconda2/envs/py36/lib/python3.6/site-packages/tensorflow/python/ops/rnn_cell_impl.py:961: calling Zeros.init (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version. Instructions for updating: Call initializer instance with the dtype argument instead of passing it to the constructor W0714 15:30:29.352713 140453550819136 deprecation.py:323] From /home/mo/miniconda2/envs/py36/lib/python3.6/site-packages/tensorflow/python/ops/rnn.py:244: add_dispatch_support..wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.where in 2.0, which has the same broadcast rule as np.where W0714 15:30:29.376541 140453550819136 deprecation_wrapper.py:119] From /mnt/c/Users/m.elkasaby/Desktop/clinical_concept_extraction/clinical_concept_extraction/bilm.py:1059: The name tf.assign is deprecated. Please use tf.compat.v1.assign instead.

W0714 15:30:29.383727 140453550819136 deprecation_wrapper.py:119] From /mnt/c/Users/m.elkasaby/Desktop/clinical_concept_extraction/clinical_concept_extraction/bilm.py:1004: The name tf.nn.rnn_cell.ResidualWrapper is deprecated. Please use tf.compat.v1.nn.rnn_cell.ResidualWrapper instead.

W0714 15:30:31.958499 140453550819136 deprecation_wrapper.py:119] From /mnt/c/Users/m.elkasaby/Desktop/clinical_concept_extraction/clinical_concept_extraction/elmo_vector.py:21: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.


TypeError Traceback (most recent call last)

in 1 # function clinical_concept_extraction takes the lists of tokens as input and outputs the annotations ----> 2 all_annotations = clinical_concept_extraction(tokenized_sentences) /mnt/c/Users/m.elkasaby/Desktop/clinical_concept_extraction/clinical_concept_extraction/pipeline.py in get_annotation(all_sentences, batch_size) 40 tf.reset_default_graph() 41 with tf.Graph().as_default(): ---> 42 dataset = tf.data.Dataset().from_generator( 43 build_generator(x, l), 44 (tf.float32, tf.int64), TypeError: Can't instantiate abstract class DatasetV1 with abstract methods _as_variant_tensor, _inputs
vpinnaka commented 5 years ago

I am getting same error, running in Google colab with tensorflow==1.14

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-13-a23dca1599ab> in <module>()
----> 1 all_annotations = clinical_concept_extraction(tokenized_sentences)

/usr/local/lib/python3.6/dist-packages/clinical_concept_extraction/pipeline.py in get_annotation(all_sentences, batch_size)
     40     tf.reset_default_graph()
     41     with tf.Graph().as_default():
---> 42         dataset = tf.data.Dataset().from_generator(
     43             build_generator(x, l),
     44             (tf.float32, tf.int64),

TypeError: Can't instantiate abstract class DatasetV1 with abstract methods _as_variant_tensor, _inputs
vpinnaka commented 5 years ago

I created a PR #4 to fix this error