This commit is contained in:
root
2019-10-23 00:30:36 +00:00
parent 9c5e80d606
commit cba5bd1827
9 changed files with 7 additions and 29 deletions
+2
View File
@@ -0,0 +1,2 @@
fastBPE
model
+1 -1
View File
@@ -23,7 +23,7 @@ class CTRLGenerator():
def __init__(self, control_code="Writing Text: ", generate_num=64, temperature=0.5, topk=40):
self.generate_num=generate_num
model_dir = "generator/ctrl/model/seqlen512_v1.ckpt/"
model_dir = "generator/ctrl/training_utils/seqlen512_v1.ckpt/"
self.control_code = control_code
vocab_file = 'generator/ctrl/model/vocab'
code_file = 'generator/ctrl/model/codes'
+1 -4
View File
@@ -4,11 +4,8 @@ cd model
# Cython is needed to compile fastBPE
pip install Cython
pip install tensorflow-gpu==1.14
pip install keras
# Patch the TensorFlow estimator package
FILE="/usr/local/lib/python2.7/dist-packages/tensorflow_estimator/python/estimator"
export FILE="/usr/local/lib/python2.7/dist-packages/tensorflow_estimator/python/estimator/keras.py"
patch -b "$FILE" estimator.patch
# Install fastBPE
-24
View File
@@ -1,24 +0,0 @@
47c47
<
---
> import tensorflow as tf
228c228
< def _create_keras_model_fn(keras_model, custom_objects=None):
---
> def _create_keras_model_fn(keras_model, params=None, custom_objects=None):
239c239
< def model_fn(features, labels, mode):
---
> def model_fn(features, labels, mode, params=None):
448c448
< if keras_model._is_graph_network:
---
> if False:
462,464c462,464
< estimator = estimator_lib.Estimator(keras_model_fn,
< config=config,
< warm_start_from=warm_start_path)
---
> estimator = tf.contrib.tpu.TPUEstimator(keras_model_fn, use_tpu=True, train_batch_size=512, eval_batch_size=32,
> config=config,
> warm_start_from=warm_start_path)
+3
View File
@@ -0,0 +1,3 @@
seqlen256_v1.ckpt
*.txt
*.tfrecords
View File
View File
View File
View File