Advertisement
pikaliov

error_infer

Apr 7th, 2020
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.62 KB | None | 0 0
  1. import tensorflow_addons as tfa
  2. import tensorflow as tf
  3. tfa.register_all()
  4.  
  5. def func_some():
  6.     dir_saved_model = '/home/pikaliov/Projects/deeppunctrestorejustencoder/models_and_weights/transformer_asr_restore/model_dir/models_1_21.15_0.78/'
  7.     loaded = tf.saved_model.load(dir_saved_model)
  8.     infer = loaded.signatures["serving_default"]
  9.     return infer
  10.  
  11. infer = func_some()
  12.  
  13. rand_val = tf.random.uniform(shape=[1, 100], maxval=15, dtype=tf.int32)
  14. res = infer(rand_val)['output_1']
  15.  
  16.  
  17. 2020-04-08 04:54:54.873749: W tensorflow/core/framework/op_kernel.cc:1655] OP_REQUIRES failed at resource_variable_ops.cc:636 : Not found: Resource localhost/transformer_encoder_model/token_encoding_embedding_conv/embedding/embeddings_14980/N10tensorflow3VarE does not exist.
  18. 2020-04-08 04:54:54.873750: W tensorflow/core/common_runtime/base_collective_executor.cc:217] BaseCollectiveExecutor::StartAbort Failed precondition: Error while reading resource variable transformer_encoder_model/encoder/encoder_layer/layer_normalization/beta_15044 from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/transformer_encoder_model/encoder/encoder_layer/layer_normalization/beta_15044/N10tensorflow3VarE does not exist.
  19.      [[{{node StatefulPartitionedCall/transformer_encoder_model/encoder/encoder_layer/layer_normalization/batchnorm/ReadVariableOp}}]]
  20.      [[StatefulPartitionedCall/transformer_encoder_model/encoder/encoder_layer/sequential/dense_3/BiasAdd/_64]]
  21. 2020-04-08 04:54:54.873942: W tensorflow/core/common_runtime/base_collective_executor.cc:217] BaseCollectiveExecutor::StartAbort Failed precondition: Error while reading resource variable transformer_encoder_model/encoder/encoder_layer/layer_normalization/beta_15044 from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/transformer_encoder_model/encoder/encoder_layer/layer_normalization/beta_15044/N10tensorflow3VarE does not exist.
  22.      [[{{node StatefulPartitionedCall/transformer_encoder_model/encoder/encoder_layer/layer_normalization/batchnorm/ReadVariableOp}}]]
  23. Traceback (most recent call last):
  24.   File "/home/pikaliov/Projects/deeppunctrestorejustencoder/src/infer.py", line 26, in <module>
  25.     res = infer(rand_val)['output_1']
  26.   File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py", line 1551, in __call__
  27.     return self._call_impl(args, kwargs)
  28.   File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py", line 1591, in _call_impl
  29.     return self._call_flat(args, self.captured_inputs, cancellation_manager)
  30.   File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/saved_model/load.py", line 99, in _call_flat
  31.     cancellation_manager)
  32.   File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py", line 1692, in _call_flat
  33.     ctx, args, cancellation_manager=cancellation_manager))
  34.   File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py", line 545, in call
  35.     ctx=ctx)
  36.   File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/eager/execute.py", line 67, in quick_execute
  37.     six.raise_from(core._status_to_exception(e.code, message), None)
  38.   File "<string>", line 3, in raise_from
  39. tensorflow.python.framework.errors_impl.FailedPreconditionError: 2 root error(s) found.
  40.   (0) Failed precondition:  Error while reading resource variable transformer_encoder_model/encoder/encoder_layer/layer_normalization/beta_15044 from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/transformer_encoder_model/encoder/encoder_layer/layer_normalization/beta_15044/N10tensorflow3VarE does not exist.
  41.      [[{{node StatefulPartitionedCall/transformer_encoder_model/encoder/encoder_layer/layer_normalization/batchnorm/ReadVariableOp}}]]
  42.      [[StatefulPartitionedCall/transformer_encoder_model/encoder/encoder_layer/sequential/dense_3/BiasAdd/_64]]
  43.   (1) Failed precondition:  Error while reading resource variable transformer_encoder_model/encoder/encoder_layer/layer_normalization/beta_15044 from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/transformer_encoder_model/encoder/encoder_layer/layer_normalization/beta_15044/N10tensorflow3VarE does not exist.
  44.      [[{{node StatefulPartitionedCall/transformer_encoder_model/encoder/encoder_layer/layer_normalization/batchnorm/ReadVariableOp}}]]
  45. 0 successful operations.
  46. 0 derived errors ignored. [Op:__inference_signature_wrapper_3901]
  47.  
  48. Function call stack:
  49. signature_wrapper -> signature_wrapper
  50.  
  51.  
  52. Process finished with exit code 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement