tensorflow / tensor2tensor

Library of deep learning models and datasets designed to make deep learning more accessible and accelerate ML research.
Apache License 2.0
15.37k stars 3.48k forks source link

NotImplementedError: exceptions are not yet supported #1662

Open nichongjia opened 5 years ago

nichongjia commented 5 years ago

After compiling the tensor2tensor from source, it can success without error.

but when just run t2t-trainer, there are some errors as the following Traceback (most recent call last): File "./t2t-trainer", line 23, in from tensor2tensor.bin import t2t_trainer File "~/anaconda3/lib/python3.6/site-packages/tensor2tensor-1.13.4-py3.6.egg/tensor2tensor/bin/t2t_trainer.py", line 24, in from tensor2tensor import models # pylint: disable=unused-import File "~/anaconda3/lib/python3.6/site-packages/tensor2tensor-1.13.4-py3.6.egg/tensor2tensor/models/init.py", line 26, in from tensor2tensor.models import basic File "~/anaconda3/lib/python3.6/site-packages/tensor2tensor-1.13.4-py3.6.egg/tensor2tensor/models/basic.py", line 25, in from tensor2tensor.utils import t2t_model File "~/anaconda3/lib/python3.6/site-packages/tensor2tensor-1.13.4-py3.6.egg/tensor2tensor/utils/t2t_model.py", line 30, in from tensor2tensor.data_generators import multi_problem File "~/anaconda3/lib/python3.6/site-packages/tensor2tensor-1.13.4-py3.6.egg/tensor2tensor/data_generators/multi_problem.py", line 22, in from tensor2tensor.data_generators import problem File "~/anaconda3/lib/python3.6/site-packages/tensor2tensor-1.13.4-py3.6.egg/tensor2tensor/data_generators/problem.py", line 27, in from tensor2tensor.data_generators import generator_utils File "~/anaconda3/lib/python3.6/site-packages/tensor2tensor-1.13.4-py3.6.egg/tensor2tensor/data_generators/generator_utils.py", line 1021, in @tf.autograph.to_graph File "~/anaconda3/lib/python3.6/site-packages/tensorflow/python/autograph/impl/api.py", line 418, in to_graph include_source_map=True) File "~/anaconda3/lib/python3.6/site-packages/tensorflow/python/autograph/pyct/compiler.py", line 130, in ast_to_object compiled_nodes = imp.load_source(module_name, f.name) File "~/anaconda3/lib/python3.6/imp.py", line 172, in load_source module = _load(spec) File "/tmp/tmptbfo0ezi.py", line 3, in @tf.autograph.to_graph File "~/anaconda3/lib/python3.6/site-packages/tensorflow/python/autograph/impl/api.py", line 409, in to_graph arg_values, arg_types) File "~/anaconda3/lib/python3.6/site-packages/tensorflow/python/autograph/impl/conversion.py", line 137, in entity_to_graph node, name, ns = function_to_graph(o, program_ctx, arg_values, arg_types) File "~/anaconda3/lib/python3.6/site-packages/tensorflow/python/autograph/impl/conversion.py", line 337, in function_to_graph node = node_to_graph(node, context) File "~/anaconda3/lib/python3.6/site-packages/tensorflow/python/autograph/impl/conversion.py", line 375, in node_to_graph node = converter.standard_analysis(node, context, is_initial=True) File "~/anaconda3/lib/python3.6/site-packages/tensorflow/python/autograph/core/converter.py", line 471, in standard_analysis graphs = cfg.build(node) File "~/anaconda3/lib/python3.6/site-packages/tensorflow/python/autograph/pyct/cfg.py", line 821, in build visitor.visit(node) File "~/anaconda3/lib/python3.6/ast.py", line 253, in visit return visitor(node) File "~/anaconda3/lib/python3.6/site-packages/tensorflow/python/autograph/pyct/cfg.py", line 674, in visit_FunctionDef self.visit(stmt) File "~/anaconda3/lib/python3.6/ast.py", line 253, in visit return visitor(node) File "~/anaconda3/lib/python3.6/site-packages/tensorflow/python/autograph/pyct/cfg.py", line 802, in visit_Try raise NotImplementedError('exceptions are not yet supported') NotImplementedError: exceptions are not yet supported ... The tensorflow version is 1.13.1 and cuda is 9.0

cantwbr commented 5 years ago

Description

I experience the same error message for t2t-decoder after upgrading to tensor2tensor release 1.14.0.

Environment information

OS: Ubuntu 16.04.6 LTS

$ pip freeze | grep tensor
mesh-tensorflow==0.0.5
tensor2tensor==1.14.0
tensorboard==1.13.1
tensorflow==1.13.1
tensorflow-datasets==1.2.0
tensorflow-estimator==1.13.0
tensorflow-gan==1.0.0.dev0
tensorflow-grpc-ops==0.0.1
tensorflow-metadata==0.12.1
tensorflow-probability==0.6.0

$ python -V
Python 2.7.12

For bugs: reproduction and error logs

# Steps to reproduce:
t2t-decoder --problem=librispeech --model=transformer --data_dir=~/datasets/t2t/librispeech/ --output_dir=~/trainoutput/librispeech/ --hparams_set=transformer_librispeech_v2

# Error logs:
Traceback (most recent call last):
  File "/home/cantbwr/t2t/bin/t2t-decoder", line 4, in <module>
    __import__('pkg_resources').run_script('tensor2tensor==1.14.0', 't2t-decoder')
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1462, in run_script
    exec(code, namespace, namespace)
  File "/home/cantbwr/t2t/lib/python2.7/site-packages/tensor2tensor-1.14.0-py2.7.egg/EGG-INFO/scripts/t2t-decoder", line 7, in <module>
    from tensor2tensor.bin import t2t_decoder
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensor2tensor-1.14.0-py2.7.egg/tensor2tensor/bin/t2t_decoder.py", line 36, in <module>
    from tensor2tensor.bin import t2t_trainer
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensor2tensor-1.14.0-py2.7.egg/tensor2tensor/bin/t2t_trainer.py", line 24, in <module>
    from tensor2tensor import models  # pylint: disable=unused-import
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensor2tensor-1.14.0-py2.7.egg/tensor2tensor/models/__init__.py", line 26, in <module>
    from tensor2tensor.models import basic
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensor2tensor-1.14.0-py2.7.egg/tensor2tensor/models/basic.py", line 25, in <module>
    from tensor2tensor.utils import t2t_model
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensor2tensor-1.14.0-py2.7.egg/tensor2tensor/utils/t2t_model.py", line 30, in <module>
    from tensor2tensor.data_generators import multi_problem
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensor2tensor-1.14.0-py2.7.egg/tensor2tensor/data_generators/multi_problem.py", line 22, in <module>
    from tensor2tensor.data_generators import problem
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensor2tensor-1.14.0-py2.7.egg/tensor2tensor/data_generators/problem.py", line 27, in <module>
    from tensor2tensor.data_generators import generator_utils
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensor2tensor-1.14.0-py2.7.egg/tensor2tensor/data_generators/generator_utils.py", line 1021, in <module>
    @tf.autograph.to_graph
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensorflow/python/autograph/impl/api.py", line 418, in to_graph
    include_source_map=True)
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensorflow/python/autograph/pyct/compiler.py", line 130, in ast_to_object
    compiled_nodes = imp.load_source(module_name, f.name)
  File "/tmp/tmpxyP8Wz.py", line 3, in <module>
    @tf.autograph.to_graph
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensorflow/python/autograph/impl/api.py", line 409, in to_graph
    arg_values, arg_types)
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensorflow/python/autograph/impl/conversion.py", line 137, in entity_to_graph
    node, name, ns = function_to_graph(o, program_ctx, arg_values, arg_types)
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensorflow/python/autograph/impl/conversion.py", line 337, in function_to_graph
    node = node_to_graph(node, context)
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensorflow/python/autograph/impl/conversion.py", line 375, in node_to_graph
    node = converter.standard_analysis(node, context, is_initial=True)
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensorflow/python/autograph/core/converter.py", line 471, in standard_analysis
    graphs = cfg.build(node)
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensorflow/python/autograph/pyct/cfg.py", line 821, in build
    visitor.visit(node)
  File "/usr/lib/python2.7/ast.py", line 241, in visit
    return visitor(node)
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensorflow/python/autograph/pyct/cfg.py", line 674, in visit_FunctionDef
    self.visit(stmt)
  File "/usr/lib/python2.7/ast.py", line 241, in visit
    return visitor(node)
  File "/home/cantbwr/t2t/local/lib/python2.7/site-packages/tensorflow/python/autograph/pyct/cfg.py", line 802, in visit_Try
    raise NotImplementedError('exceptions are not yet supported')
NotImplementedError: exceptions are not yet supported
shayanfazeli commented 5 years ago

This sort of problem is mostly associated with version mismatch - lost utilities (which cannot be found in the incorrect version).

Try upgrading your tensorflow and tensorflow-probability package just in case: pip3 install --upgrade tensorflow-gpu tensorflow-probability

If any other package caused problems, try upgrading them too.