Open SivamPillai opened 5 years ago
+1 That would be cool! And the library could work like this, for the moment tf.contrib doesn't exist
I solved it by using:
# vocab_words = tf.contrib.lookup.index_table_from_file(
# params['words'], num_oov_buckets=params['num_oov_buckets'])
num_oov_buckets = params['num_oov_buckets']
vocab_words = tf.lookup.StaticVocabularyTable(
tf.lookup.TextFileInitializer(
params['words'],
key_dtype=tf.string, key_index=tf.lookup.TextFileIndex.WHOLE_LINE,
value_dtype=tf.int64, value_index=tf.lookup.TextFileIndex.LINE_NUMBER,
delimiter="\t"),
num_oov_buckets)
# vocab_chars = tf.contrib.lookup.index_table_from_file(
# params['chars'], num_oov_buckets=params['num_oov_buckets'])
vocab_chars = tf.lookup.StaticVocabularyTable(
tf.lookup.TextFileInitializer(
params['chars'],
key_dtype=tf.string, key_index=tf.lookup.TextFileIndex.WHOLE_LINE,
value_dtype=tf.int64, value_index=tf.lookup.TextFileIndex.LINE_NUMBER,
delimiter="\t"),
num_oov_buckets)
Dear xavierad, I cannot imagine that that is the only alteration you made. I get error messages that LSTMBlockFusedCell is no longer supported with TF 2.0 which is confirmed online.
Yes. I just copied the class code to local. Tensorflow sucks
Interesting, could you push those changes to your fork?
Here is my fork with TF2 implementation of one of the models:
https://github.com/iprovalo/tf_ner/tree/master/models/chars_conv_lstm_crf_tf2
Hi,
Are there any plan to upgrade the library to support TF 2.0? I feel some of the new features can help simplify the code library and may also improve performance.
Thanks, Sivam.