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

AttributeError: 'Operation' object has no attribute '_c_op' #10

Open
888yyh opened this issue Aug 12, 2021 · 0 comments
Open

AttributeError: 'Operation' object has no attribute '_c_op' #10

888yyh opened this issue Aug 12, 2021 · 0 comments

Comments

@888yyh
Copy link

888yyh commented Aug 12, 2021

tensorflow2.1
dear professor, i met this error,hope you could help me.Thank you.
Traceback (most recent call last):
File "run.py", line 118, in
imgs_mask_test = model.predict(imagestest, verbose=1)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py", line 1013, in predict
use_multiprocessing=use_multiprocessing)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_v2.py", line 498, in predict
workers=workers, use_multiprocessing=use_multiprocessing, **kwargs)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_v2.py", line 475, in _model_iteration
total_epochs=1)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_v2.py", line 128, in run_one_epoch
batch_outs = execution_function(iterator)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_v2_utils.py", line 98, in execution_function
distributed_function(input_fn))
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/eager/def_function.py", line 568, in call
result = self._call(*args, **kwds)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/eager/def_function.py", line 615, in _call
self._initialize(args, kwds, add_initializers_to=initializers)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/eager/def_function.py", line 497, in _initialize
*args, **kwds))
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py", line 2389, in _get_concrete_function_internal_garbage_collected
graph_function, _, _ = self._maybe_define_function(args, kwargs)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py", line 2703, in _maybe_define_function
graph_function = self._create_graph_function(args, kwargs)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py", line 2593, in _create_graph_function
capture_by_value=self._capture_by_value),
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/framework/func_graph.py", line 978, in func_graph_from_py_func
func_outputs = python_func(*func_args, **func_kwargs)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/eager/def_function.py", line 439, in wrapped_fn
return weak_wrapped_fn().wrapped(*args, **kwds)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_v2_utils.py", line 85, in distributed_function
per_replica_function, args=args)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/distribute/distribute_lib.py", line 763, in experimental_run_v2
return self._extended.call_for_each_replica(fn, args=args, kwargs=kwargs)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/distribute/distribute_lib.py", line 1819, in call_for_each_replica
return self._call_for_each_replica(fn, args, kwargs)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/distribute/distribute_lib.py", line 2164, in _call_for_each_replica
return fn(*args, **kwargs)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/autograph/impl/api.py", line 292, in wrapper
return func(*args, **kwargs)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_v2_utils.py", line 212, in _predict_on_batch
result = predict_on_batch(model, x)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_v2_utils.py", line 556, in predict_on_batch
return predict_on_batch_fn(inputs) # pylint: disable=not-callable
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 778, in call
outputs = call_fn(cast_inputs, *args, **kwargs)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/network.py", line 717, in call
convert_kwargs_to_constants=base_layer_utils.call_context().saving)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/network.py", line 891, in _run_internal_graph
output_tensors = layer(computed_tensors, **kwargs)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 778, in call
outputs = call_fn(cast_inputs, *args, **kwargs)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/keras/layers/convolutional.py", line 209, in call
outputs = self._convolution_op(inputs, self.kernel)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/ops/nn_ops.py", line 1135, in call
return self.conv_op(inp, filter)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/ops/nn_ops.py", line 640, in call
return self.call(inp, filter)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/ops/nn_ops.py", line 616, in _with_space_to_batch_call
block_shape=self.dilation_rate)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/ops/array_ops.py", line 3303, in required_space_to_batch_paddings
const_block_shape = tensor_util.constant_value(block_shape)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/framework/tensor_util.py", line 827, in constant_value
ret = _ConstantValue(tensor, partial)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/framework/tensor_util.py", line 673, in _ConstantValue
if tensor.op.type == "Const":
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 2220, in type
return c_api.TF_OperationOpType(self._c_op)
AttributeError: 'Operation' object has no attribute '_c_op'

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

1 participant