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

Test failed when running sudo python3 setup.py test #185

Open
avasyukhin opened this issue Nov 18, 2019 · 2 comments
Open

Test failed when running sudo python3 setup.py test #185

avasyukhin opened this issue Nov 18, 2019 · 2 comments

Comments

@avasyukhin
Copy link

I've just installed g2p-seq2seq via
sudo python3 setup.py test
Before that I've installed the latest setuptools and tensorflow versions.
But when I run
sudo python3 setup.py test
I've got

Training started.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/training/training_util.py:236: Variable.initialized_value (from tensorflow.python.ops.variables) is deprecated and will be removed in a future version.
Instructions for updating:
Use Variable.read_value. Variables in 2.X are initialized automatically both in eager and graph (inside tf.defun) contexts.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensor2tensor-1.7.0-py3.6.egg/tensor2tensor/data_generators/problem.py:165: tf_record_iterator (from tensorflow.python.lib.io.tf_record) is deprecated and will be removed in a future version.
Instructions for updating:
Use eager execution and: 
`tf.data.TFRecordDataset(path)`
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensor2tensor-1.7.0-py3.6.egg/tensor2tensor/utils/data_reader.py:103: group_by_window (from tensorflow.contrib.data.python.ops.grouping) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.data.experimental.group_by_window(...)`.
ERROR

======================================================================
ERROR: test_train (tests.g2p_unittest.TestG2P)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/antonvasyukhin/g2p-seq2seq/tests/g2p_unittest.py", line 24, in test_train
    g2p_model.train()
  File "/home/antonvasyukhin/g2p-seq2seq/g2p_seq2seq/g2p.py", line 258, in train
    execute_schedule(self.exp, self.params)
  File "/home/antonvasyukhin/g2p-seq2seq/g2p_seq2seq/g2p.py", line 590, in execute_schedule
    getattr(exp, params.schedule)()
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor-1.7.0-py3.6.egg/tensor2tensor/utils/trainer_lib.py", line 309, in continuous_train_and_eval
    self._eval_spec)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 473, in train_and_evaluate
    return executor.run()
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 613, in run
    return self.run_local()
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 714, in run_local
    saving_listeners=saving_listeners)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 367, in train
    loss = self._train_model(input_fn, hooks, saving_listeners)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1158, in _train_model
    return self._train_model_default(input_fn, hooks, saving_listeners)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1185, in _train_model_default
    input_fn, ModeKeys.TRAIN))
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1022, in _get_features_and_labels_from_input_fn
    self._call_input_fn(input_fn, mode))
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1113, in _call_input_fn
    return input_fn(**kwargs)
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor-1.7.0-py3.6.egg/tensor2tensor/data_generators/problem.py", line 733, in estimator_input_fn
    dataset_kwargs=dataset_kwargs)
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor-1.7.0-py3.6.egg/tensor2tensor/data_generators/problem.py", line 895, in input_fn
    batching_scheme["batch_sizes"])
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor-1.7.0-py3.6.egg/tensor2tensor/utils/data_reader.py", line 103, in bucket_by_sequence_length
    window_size_fn))
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/ops/dataset_ops.py", line 1853, in apply
    return DatasetV1Adapter(super(DatasetV1, self).apply(transformation_func))
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/ops/dataset_ops.py", line 1290, in apply
    dataset = transformation_func(self)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/experimental/ops/grouping.py", line 121, in _apply_fn
    window_size_func)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/experimental/ops/grouping.py", line 377, in __init__
    self._make_reduce_func(reduce_func, input_dataset)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/experimental/ops/grouping.py", line 424, in _make_reduce_func
    input_structure=input_structure)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/ops/dataset_ops.py", line 2555, in __init__
    self._function = wrapper_fn._get_concrete_function_internal()
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/function.py", line 1355, in _get_concrete_function_internal
    *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/function.py", line 1349, in _get_concrete_function_internal_garbage_collected
    graph_function, _, _ = self._maybe_define_function(args, kwargs)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/function.py", line 1652, in _maybe_define_function
    graph_function = self._create_graph_function(args, kwargs)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/function.py", line 1545, in _create_graph_function
    capture_by_value=self._capture_by_value),
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/func_graph.py", line 715, in func_graph_from_py_func
    func_outputs = python_func(*func_args, **func_kwargs)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/ops/dataset_ops.py", line 2549, in wrapper_fn
    ret = _wrapper_helper(*args)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/ops/dataset_ops.py", line 2489, in _wrapper_helper
    ret = func(*nested_args)
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor-1.7.0-py3.6.egg/tensor2tensor/utils/data_reader.py", line 99, in batching_fn
    return padded_batch(grouped_dataset, batch_size, padded_shapes)
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor-1.7.0-py3.6.egg/tensor2tensor/utils/data_reader.py", line 110, in padded_batch
    for name, shape in dataset.output_shapes.items()])
AttributeError: '_VariantDataset' object has no attribute 'output_shapes'

----------------------------------------------------------------------
Ran 3 tests in 11.141s

FAILED (errors=1)
Test failed: <unittest.runner.TextTestResult run=3 errors=1 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=3 errors=1 failures=0>

Is this an issue or am I doing something wrong?

@TristanKnot
Copy link

@avasyukhin I received this same issue. I'm curious if you found a solution?

@DanielLoney
Copy link

I recently had to use this repo and had a number of difficulties setting it up. Once I made sure I had all the correct versions of the dependencies, it started to run fine though. Have you checked that you have the right versions of the dependencies, as the last commit is over a year old already.

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

No branches or pull requests

3 participants