cmusphinx / g2p-seq2seq

G2P with Tensorflow
Other
670 stars 194 forks source link

errors in test - with new versions of tensor2tensor=>1.6.0 #117

Closed shahawi closed 6 years ago

shahawi commented 6 years ago

Hi, after running test I get those errors please advice Thanks.

"(tensorflow) hosni@hosni-Inspiron-3521:~/g2p-seq2seq$ python setup.py test
running test
running egg_info
writing requirements to g2p_seq2seq.egg-info/requires.txt
writing g2p_seq2seq.egg-info/PKG-INFO
writing top-level names to g2p_seq2seq.egg-info/top_level.txt
writing dependency_links to g2p_seq2seq.egg-info/dependency_links.txt
writing entry points to g2p_seq2seq.egg-info/entry_points.txt
reading manifest file 'g2p_seq2seq.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'g2p_seq2seq.egg-info/SOURCES.txt'
running build_ext
test_decode (tests.g2p_unittest.TestG2P) ... WARNING:tensorflow:Schedule=train_and_evaluate. Assuming that training is running on a single machine.
WARNING:tensorflow:Estimator's model_fn (<function wrapping_model_fn at 0x7ffb85e23410>) includes params argument, but params are not passed to Estimator.
WARNING:tensorflow:From /home/hosni/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/monitors.py:267: __init__ (from tensorflow.contrib.learn.python.learn.monitors) is deprecated and will be removed after 2016-12-05.
Instructions for updating:
Monitors are deprecated. Please use tf.train.SessionRunHook.
WARNING:tensorflow:Estimator's model_fn (<function wrapping_model_fn at 0x7ffb81d12de8>) includes params argument, but params are not passed to Estimator.
ERROR
test_evaluate (tests.g2p_unittest.TestG2P) ... WARNING:tensorflow:Schedule=train_and_evaluate. Assuming that training is running on a single machine.
WARNING:tensorflow:Estimator's model_fn (<function wrapping_model_fn at 0x7ffb85e23a28>) includes params argument, but params are not passed to Estimator.
WARNING:tensorflow:Estimator's model_fn (<function wrapping_model_fn at 0x7ffb81d12de8>) includes params argument, but params are not passed to Estimator.
ERROR
test_train (tests.g2p_unittest.TestG2P) ... WARNING:tensorflow:Schedule=train_and_evaluate. Assuming that training is running on a single machine.
WARNING:tensorflow:Estimator's model_fn (<function wrapping_model_fn at 0x7ffb81d12ed8>) includes params argument, but params are not passed to Estimator.
WARNING:tensorflow:Estimator's model_fn (<function wrapping_model_fn at 0x7ffb81895050>) includes params argument, but params are not passed to Estimator.
WARNING:tensorflow:Without a Problem, T2TModel.bottom is a passthrough.
ERROR

======================================================================
ERROR: test_decode (tests.g2p_unittest.TestG2P)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hosni/g2p-seq2seq/tests/g2p_unittest.py", line 33, in test_decode
    g2p_model.decode(output_file_path=output_file_path)
  File "/home/hosni/g2p-seq2seq/g2p_seq2seq/g2p.py", line 271, in decode
    inputs, decodes = self.__decode_from_file(self.file_path)
  File "/home/hosni/g2p-seq2seq/g2p_seq2seq/g2p.py", line 406, in __decode_from_file
    problem_id = self.decode_hp.problem_idx
AttributeError: 'HParams' object has no attribute 'problem_idx'

======================================================================
ERROR: test_evaluate (tests.g2p_unittest.TestG2P)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hosni/g2p-seq2seq/tests/g2p_unittest.py", line 45, in test_evaluate
    g2p_model.evaluate()
  File "/home/hosni/g2p-seq2seq/g2p_seq2seq/g2p.py", line 307, in evaluate
    correct, errors = self.calc_errors(self.file_path)
  File "/home/hosni/g2p-seq2seq/g2p_seq2seq/g2p.py", line 458, in calc_errors
    inputs, decodes = self.__decode_from_file(decode_file_path)
  File "/home/hosni/g2p-seq2seq/g2p_seq2seq/g2p.py", line 406, in __decode_from_file
    problem_id = self.decode_hp.problem_idx
AttributeError: 'HParams' object has no attribute 'problem_idx'

======================================================================
ERROR: test_train (tests.g2p_unittest.TestG2P)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hosni/g2p-seq2seq/tests/g2p_unittest.py", line 23, in test_train
    g2p_model.train()
  File "/home/hosni/g2p-seq2seq/g2p_seq2seq/g2p.py", line 242, in train
    execute_schedule(self.exp, self.params)
  File "/home/hosni/g2p-seq2seq/g2p_seq2seq/g2p.py", line 593, in execute_schedule
    getattr(exp, params.schedule)()
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 661, in train_and_evaluate
    self.train(delay_secs=0)
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 390, in train
    saving_listeners=self._saving_listeners)
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 868, in _call_train
    saving_listeners=saving_listeners)
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/estimator/estimator.py", line 314, in train
    loss = self._train_model(input_fn, hooks, saving_listeners)
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/estimator/estimator.py", line 743, in _train_model
    features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/estimator/estimator.py", line 725, in _call_model_fn
    model_fn_results = self._model_fn(features=features, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tensor2tensor-1.6.1-py2.7.egg/tensor2tensor/utils/t2t_model.py", line 916, in wrapping_model_fn
    use_tpu=use_tpu)
  File "/usr/local/lib/python2.7/dist-packages/tensor2tensor-1.6.1-py2.7.egg/tensor2tensor/utils/t2t_model.py", line 966, in estimator_model_fn
    logits, losses_dict = model(features)  # pylint: disable=not-callable
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/layers/base.py", line 652, in __call__
    outputs = self.call(inputs, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tensor2tensor-1.6.1-py2.7.egg/tensor2tensor/utils/t2t_model.py", line 154, in call
    sharded_logits, losses = self.model_fn_sharded(sharded_features)
  File "/usr/local/lib/python2.7/dist-packages/tensor2tensor-1.6.1-py2.7.egg/tensor2tensor/utils/t2t_model.py", line 209, in model_fn_sharded
    sharded_logits, sharded_losses = dp(self.model_fn, datashard_to_features)
  File "/usr/local/lib/python2.7/dist-packages/tensor2tensor-1.6.1-py2.7.egg/tensor2tensor/utils/expert_utils.py", line 252, in __call__
    outputs.append(fns[i](*my_args[i], **my_kwargs[i]))
  File "/usr/local/lib/python2.7/dist-packages/tensor2tensor-1.6.1-py2.7.egg/tensor2tensor/utils/t2t_model.py", line 242, in model_fn
    body_out = self.body(transformed_features)
  File "/usr/local/lib/python2.7/dist-packages/tensor2tensor-1.6.1-py2.7.egg/tensor2tensor/models/transformer.py", line 157, in body
    inputs, target_space, hparams, features=features)
  File "/usr/local/lib/python2.7/dist-packages/tensor2tensor-1.6.1-py2.7.egg/tensor2tensor/models/transformer.py", line 77, in encode
    inputs, target_space, hparams, features=features))
  File "/usr/local/lib/python2.7/dist-packages/tensor2tensor-1.6.1-py2.7.egg/tensor2tensor/models/transformer.py", line 652, in transformer_prepare_encoder
    encoder_padding = common_attention.embedding_to_padding(encoder_input)
  File "/usr/local/lib/python2.7/dist-packages/tensor2tensor-1.6.1-py2.7.egg/tensor2tensor/utils/expert_utils.py", line 83, in decorated
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tensor2tensor-1.6.1-py2.7.egg/tensor2tensor/layers/common_attention.py", line 688, in embedding_to_padding
    return tf.to_float(tf.equal(emb_sum, 0.0))
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/gen_math_ops.py", line 1498, in equal
    "Equal", x=x, y=y, name=name)
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 519, in _apply_op_helper
    repr(values), type(values).__name__))
TypeError: Expected int32 passed to parameter 'y' of op 'Equal', got 0.0 of type 'float' instead.

----------------------------------------------------------------------
Ran 3 tests in 0.419s

FAILED (errors=3)
Test failed: <unittest.runner.TextTestResult run=3 errors=3 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=3 errors=3 `failures=0>"`
nurtas-m commented 6 years ago

This error occurred with new tensor2tensor starting from version 1.6.0. We are working on this issue now. Please, install the previous version of tensor2tensor=1.5.7

shahawi commented 6 years ago

Hi, Is there a way to install older version of tensorflow for cpu in ubuntu Thanks

nurtas-m commented 6 years ago

Yes, please read the tensorflow installation documentation: https://www.tensorflow.org/install/install_linux#the_url_of_the_tensorflow_python_package

shahawi commented 6 years ago

Hi, I installed version 1.5 of tensorflow and tensor2tensor but now I get this error Thanks in advance.

(tensorflow) hosni@hosni-Inspiron-3521:~/g2p-seq2seq$ python setup.py test
running test
running egg_info
writing requirements to g2p_seq2seq.egg-info/requires.txt
writing g2p_seq2seq.egg-info/PKG-INFO
writing top-level names to g2p_seq2seq.egg-info/top_level.txt
writing dependency_links to g2p_seq2seq.egg-info/dependency_links.txt
writing entry points to g2p_seq2seq.egg-info/entry_points.txt
reading manifest file 'g2p_seq2seq.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'g2p_seq2seq.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File "setup.py", line 53, in <module>
    test_suite = 'tests'
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/setuptools/command/test.py", line 226, in run
    self.run_tests()
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/setuptools/command/test.py", line 248, in run_tests
    exit=False,
  File "/usr/lib/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python2.7/unittest/main.py", line 149, in parseArgs
    self.createTests()
  File "/usr/lib/python2.7/unittest/main.py", line 158, in createTests
    self.module)
  File "/usr/lib/python2.7/unittest/loader.py", line 130, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python2.7/unittest/loader.py", line 91, in loadTestsFromName
    module = __import__('.'.join(parts_copy))
  File "/home/hosni/g2p-seq2seq/tests/__init__.py", line 23, in <module>
    from tests import g2p_unittest
  File "/home/hosni/g2p-seq2seq/tests/g2p_unittest.py", line 4, in <module>
    import g2p_seq2seq.g2p as g2p
  File "/home/hosni/g2p-seq2seq/g2p_seq2seq/__init__.py", line 28, in <module>
    from g2p_seq2seq import g2p_problem
  File "/home/hosni/g2p-seq2seq/g2p_seq2seq/g2p_problem.py", line 32, in <module>
    from tensor2tensor.data_generators import text_problems
ImportError: cannot import name text_problems
(tensorflow) hosni@hosni-Inspiron-3521:~/g2p-seq2seq$ python setup.py test
nurtas-m commented 6 years ago

What version of tensor2tensor had you install? Can you, please, check: >>> import pkg_resources >>> pkg_resources.get_distribution("tensor2tensor").version

shahawi commented 6 years ago

'1.5.0'

sorry for late reply

shahawi commented 6 years ago

now I get this

(tensorflow) hosni@hosni-Inspiron-3521:~$ g2p-seq2seq --interactive --model_dir  /home/hosni/g2p-seq2seq/g2p-seq2seq-cmudict
Traceback (most recent call last):
  File "/home/hosni/tensorflow/bin/g2p-seq2seq", line 11, in <module>
    load_entry_point('g2p-seq2seq==6.1.3a0', 'console_scripts', 'g2p-seq2seq')()
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 561, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2291, in load
    return self.resolve()
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2297, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/g2p_seq2seq-6.1.3a0-py2.7.egg/g2p_seq2seq/__init__.py", line 28, in <module>
    from g2p_seq2seq import g2p_problem
  File "/home/hosni/tensorflow/local/lib/python2.7/site-packages/g2p_seq2seq-6.1.3a0-py2.7.egg/g2p_seq2seq/g2p_problem.py", line 32, in <module>
    from tensor2tensor.data_generators import text_problems
ImportError: cannot import name text_problems
(tensorflow) hosni@hosni-Inspiron-3521:~$ 
shahawi commented 6 years ago

Also

(tensorflow) hosni@hosni-Inspiron-3521:~/g2p-seq2seq$ sudo python setup.py test
running test
running egg_info
writing requirements to g2p_seq2seq.egg-info/requires.txt
writing g2p_seq2seq.egg-info/PKG-INFO
writing top-level names to g2p_seq2seq.egg-info/top_level.txt
writing dependency_links to g2p_seq2seq.egg-info/dependency_links.txt
writing entry points to g2p_seq2seq.egg-info/entry_points.txt
reading manifest file 'g2p_seq2seq.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'g2p_seq2seq.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File "setup.py", line 53, in <module>
    test_suite = 'tests'
  File "/usr/lib/python2.7/dist-packages/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/test.py", line 226, in run
    self.run_tests()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/test.py", line 248, in run_tests
    exit=False,
  File "/usr/lib/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python2.7/unittest/main.py", line 149, in parseArgs
    self.createTests()
  File "/usr/lib/python2.7/unittest/main.py", line 158, in createTests
    self.module)
  File "/usr/lib/python2.7/unittest/loader.py", line 130, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python2.7/unittest/loader.py", line 91, in loadTestsFromName
    module = __import__('.'.join(parts_copy))
  File "/home/hosni/g2p-seq2seq/tests/__init__.py", line 23, in <module>
    from tests import g2p_unittest
  File "/home/hosni/g2p-seq2seq/tests/g2p_unittest.py", line 4, in <module>
    import g2p_seq2seq.g2p as g2p
  File "/home/hosni/g2p-seq2seq/g2p_seq2seq/__init__.py", line 28, in <module>
    from g2p_seq2seq import g2p_problem
  File "/home/hosni/g2p-seq2seq/g2p_seq2seq/g2p_problem.py", line 32, in <module>
    from tensor2tensor.data_generators import text_problems
ImportError: cannot import name text_problems
(tensorflow) hosni@hosni-Inspiron-3521:~/g2p-seq2seq$ 
shahawi commented 6 years ago
(tensorflow) hosni@hosni-Inspiron-3521:~/g2p-seq2seq$ pip show tensorflow
Name: tensorflow
Version: 1.5.0
Summary: TensorFlow helps the tensors flow
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /home/hosni/tensorflow/lib/python2.7/site-packages
Requires: mock, protobuf, wheel, absl-py, backports.weakref, enum34, six, numpy, tensorflow-tensorboard
Required-by: 
(tensorflow) hosni@hosni-Inspiron-3521:~/g2p-seq2seq$ pip show tensor2tensor
Name: tensor2tensor
Version: 1.5.0
Summary: Tensor2Tensor
Home-page: http://github.com/tensorflow/tensor2tensor
Author: Google Inc.
Author-email: no-reply@google.com
License: Apache 2.0
Location: /usr/local/lib/python2.7/dist-packages
Requires: six, numpy, requests, flask, gunicorn, google-api-python-client, bz2file, gevent, sympy, scipy, future, gym
Required-by: g2p-seq2seq
nurtas-m commented 6 years ago

Ok, I could reproduce your error. Install the tensor2tensor version=1.5.7

nurtas-m commented 6 years ago

Duplicate of issue #114

nimaous commented 6 years ago

Im having the same problem in decoding but with t2t version 1.5.4

nurtas-m commented 6 years ago

@nimaous Can you, please, install t2t version 1.5.7 ?

nimaous commented 6 years ago

I installed v 1.5.7 but still the same error


Traceback (most recent call last):
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensorflow/python/framework/op_def_library.py", line 510, in _apply_op_helper
    preferred_dtype=default_dtype)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensorflow/python/framework/ops.py", line 1036, in internal_convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensorflow/python/framework/constant_op.py", line 235, in _constant_tensor_conversion_function
    return constant(v, dtype=dtype, name=name)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensorflow/python/framework/constant_op.py", line 214, in constant
    value, dtype=dtype, shape=shape, verify_shape=verify_shape))
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensorflow/python/framework/tensor_util.py", line 433, in make_tensor_proto
    _AssertCompatible(values, dtype)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensorflow/python/framework/tensor_util.py", line 344, in _AssertCompatible
    (dtype.name, repr(mismatch), type(mismatch).__name__))
TypeError: Expected int32, got 0.0 of type 'float' instead.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/sopran/rafiee/py3/bin/t2t-decoder", line 16, in <module>
    tf.app.run()
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "/sopran/rafiee/py3/bin/t2t-decoder", line 12, in main
    t2t_decoder.main(argv)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensor2tensor/bin/t2t_decoder.py", line 188, in main
    decode(estimator, hp, decode_hp)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensor2tensor/bin/t2t_decoder.py", line 101, in decode
    dataset_split="test" if FLAGS.eval_use_test_set else None)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensor2tensor/utils/decoding.py", line 160, in decode_from_dataset
    for num_predictions, prediction in enumerate(predictions):
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensorflow/python/estimator/estimator.py", line 479, in predict
    features, None, model_fn_lib.ModeKeys.PREDICT, self.config)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensorflow/python/estimator/estimator.py", line 793, in _call_model_fn
    model_fn_results = self._model_fn(features=features, **kwargs)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensor2tensor/utils/t2t_model.py", line 889, in wrapping_model_fn
    use_tpu=use_tpu)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensor2tensor/utils/t2t_model.py", line 934, in estimator_model_fn
    return model.estimator_spec_predict(features)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensor2tensor/utils/t2t_model.py", line 1057, in estimator_spec_predict
    decode_length=decode_hparams.extra_length)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensor2tensor/utils/t2t_model.py", line 540, in infer
    top_beams, alpha)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensor2tensor/models/transformer.py", line 293, in _beam_decode
    features, decode_length, beam_size, top_beams, alpha)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensor2tensor/models/transformer.py", line 363, in _fast_decode
    inputs, features["target_space_id"], hparams, orig_inp, features=features, template_flag=False)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensor2tensor/utils/expert_utils.py", line 254, in __call__
    outputs.append(fns[i](*my_args[i], **my_kwargs[i]))
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensor2tensor/models/transformer.py", line 99, in encode
    orig_inp, target_space, hparams, features=features))
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensor2tensor/models/transformer.py", line 649, in transformer_prepare_encoder
    encoder_padding = common_attention.embedding_to_padding(encoder_input)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensor2tensor/utils/expert_utils.py", line 85, in decorated
    return f(*args, **kwargs)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensor2tensor/layers/common_attention.py", line 690, in embedding_to_padding
    return tf.to_float(tf.equal(emb_sum, 0.0))
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensorflow/python/ops/gen_math_ops.py", line 1489, in equal
    "Equal", x=x, y=y, name=name)
  File "/sopran/rafiee/py3/lib/python3.4/site-packages/tensorflow/python/framework/op_def_library.py", line 519, in _apply_op_helper
    repr(values), type(values).__name__))
TypeError: Expected int32 passed to parameter 'y' of op 'Equal', got 0.0 of type 'float' instead.
nimaous commented 6 years ago

Just good to know that in transformer model. I split my input and feed into the two seperate encoders. in _fast_decode I also splite my input data and call encoder twice with two splited inputs. in training and evaluation it works perfect but in decoding by calling below function I got the error. the point is that this function is also called in transformer body (when encoder is called) without any error ( in training and evaluation phase)

dp(self.encode,
            inputs1, features["target_space_id"], hparams, original_inp, features=features, template_flag=False)
shahawi commented 6 years ago

Hi @nimaous have you tried checking out the latest commit it fixed my problems

nimaous commented 6 years ago

Hi @shahawi can you send me a link to that commit?

shahawi commented 6 years ago

Git pull the repository from the same directory

nekulkarni commented 6 years ago

I'm not sure whether this is the same error or not, but I saw a similar error when trying to kick of object detection training:

WARNING:tensorflow:Estimator's model_fn (<function create_model_fn.<locals>.model_fn at 0x7f464c3ed7b8>) includes params argument, but params are not passed to Estimator.

The rootcause was that I had a really small number of training steps --num_train_steps given to object_detection/model_main.py script, that was smaller than the number of eval steps --num_eval_steps given to the script, and also smaller than number of steps specified in graph_rewriter.quantization.delay parameter. When I made num_train_steps to be higher than both of them, I stopped seeing the error and the training script ran successfully.

tringn commented 6 years ago

@nekulkarni I got the warning as yours.

WARNING:tensorflow:Forced number of epochs for all eval validations to be 1. W1016 14:59:22.730520 139906006693376 tf_logging.py:125] Forced number of epochs for all eval validations to be 1. WARNING:tensorflow:Expected number of evaluation epochs is 1, but instead encountered eval_on_train_input_config.num_epochs = 0. Overwriting num_epochs to 1. W1016 14:59:22.730715 139906006693376 tf_logging.py:125] Expected number of evaluation epochs is 1, but instead encountered eval_on_train_input_config.num_epochs = 0. Overwriting num_epochs to 1. WARNING:tensorflow:Estimator's model_fn (<function create_model_fn..model_fn at 0x7f3e2a437048>) includes params argument, but params are not passed to Estimator. W1016 14:59:22.731023 139906006693376 tf_logging.py:125] Estimator's model_fn (<function create_model_fn..model_fn at 0x7f3e2a437048>) includes params argument, but params are not passed to Estimator.

The param numtrain_steps I used is 200000. I set num_examples = 408 and max_evals = 10 in eval_config (pipeline_config file). Can you suggest any solution? Thanks

nekulkarni commented 6 years ago

@tringn Can you share what arguments you provided to your model_main.py?