Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We can upgrade the code to compatible with tf1.0.0 by the following diff: #8

Open
SeekPoint opened this issue Apr 7, 2017 · 2 comments

Comments

@SeekPoint
Copy link

git diff

diff --git a/ByteNet/model.py b/ByteNet/model.py
index 4cfe3b3..3a12b5b 100644
--- a/ByteNet/model.py
+++ b/ByteNet/model.py
@@ -138,7 +138,7 @@ class Byte_net_model:
decoder_output = self.decoder(source_embedding)
loss = self.loss(decoder_output, target_sentence)

  •           tf.scalar_summary('LOSS', loss)
    
  •           tf.summary.scalar('LOSS', loss)
    
              flat_logits = tf.reshape( decoder_output, [-1, options['n_target_quant']])
              prediction = tf.argmax(flat_logits, 1)
    

@@ -220,7 +220,7 @@ class Byte_net_model:

            flat_logits = tf.reshape( decoder_output, [-1, options['n_target_quant']])
            flat_targets = tf.reshape( target_one_hot, [-1, options['n_target_quant']])
  •           loss = tf.nn.softmax_cross_entropy_with_logits(flat_logits, flat_targets, name='decoder_cross_entropy_loss')
    
  •           loss = tf.nn.softmax_cross_entropy_with_logits(logits=flat_logits, labels=flat_targets, name='decoder_cross_entropy_loss')
    
              if 'target_mask_chars' in options:
                      # MASK LOSS BEYOND EOL IN TARGET
    

diff --git a/train_generator.py b/train_generator.py
index 78d502c..72e898b 100644

@SeekPoint SeekPoint reopened this Aug 15, 2017
@SeekPoint
Copy link
Author

W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
Traceback (most recent call last):
File "train_translator.py", line 144, in
main()
File "train_translator.py", line 89, in main
bn_tensors = byte_net.build_translation_model(sample_size = key)
File "/Users/yike.ke/yike_prj/byteNet-tensorflow/ByteNet/model.py", line 90, in build_translation_model
decoder_output = self.decoder(target1_embedding, encoder_output)
File "/Users/yike.ke/yike_prj/byteNet-tensorflow/ByteNet/model.py", line 259, in decoder
curr_input = tf.concat(2, [input_, encoder_embedding])
File "/Users/yike.ke/yike_prj/ve_tf1.0_py2/venv/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1029, in concat
dtype=dtypes.int32).get_shape(
File "/Users/yike.ke/yike_prj/ve_tf1.0_py2/venv/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 637, in convert_to_tensor
as_ref=False)
File "/Users/yike.ke/yike_prj/ve_tf1.0_py2/venv/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 702, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/Users/yike.ke/yike_prj/ve_tf1.0_py2/venv/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 110, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/Users/yike.ke/yike_prj/ve_tf1.0_py2/venv/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 99, in constant
tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape))
File "/Users/yike.ke/yike_prj/ve_tf1.0_py2/venv/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 367, in make_tensor_proto
_AssertCompatible(values, dtype)
File "/Users/yike.ke/yike_prj/ve_tf1.0_py2/venv/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 302, in _AssertCompatible
(dtype.name, repr(mismatch), type(mismatch).name))
TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

maybe I am wrong, it is report error above on tf1.0 or tf1.2

@fajieyuan
Copy link

I am not sure about masked 1d, It seems that the mask operation is done on difference channels like image in RGB channel. Do you think your implementation here is in line with the paper, see pixelRNN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants