NervanaSystems / ngraph

nGraph has moved to OpenVINO
https://www.ngraph.ai/
Apache License 2.0
1.36k stars 221 forks source link

TypeError: Failed to convert object of type <class ‘plaidml.tile.Value’> to Tensor. #4721

Closed jasdal365 closed 4 years ago

jasdal365 commented 4 years ago

Hi! The plaidml installation succeed, but there are some problems with the tensors: To avoid tensorflow operations, I installed ngraph_bridge, but I got this error:

Traceback (most recent call last): File “/Users/jasmindalferth/Documents/Mask R-CNN/env/lib/python3.7/site-packages/tensorflow/python/framework/tensor_util.py”, line 558, in make_tensor_proto str_values = [compat.as_bytes(x) for x in proto_values] File “/Users/jasmindalferth/Documents/Mask R-CNN/env/lib/python3.7/site-packages/tensorflow/python/framework/tensor_util.py”, line 558, in <listcomp> str_values = [compat.as_bytes(x) for x in proto_values] File “/Users/jasmindalferth/Documents/Mask R-CNN/env/lib/python3.7/site-packages/tensorflow/python/util/compat.py”, line 65, in as_bytes (bytes_or_text,)) TypeError: Expected binary or unicode string, got <tile.Value Add FLOAT32(<tile.Value SymbolicDim UINT64()>, <tile.Value Add FLOAT64()>, <tile.Value Add FLOAT64()>, 6)> During handling of the above exception, another exception occurred: Traceback (most recent call last): File “/Users/jasmindalferth/Documents/Mask R-CNN/3_validate.py”, line 160, in <module> model = modellib.MaskRCNN(mode=“inference”, config=ValConfig(), model_dir=RESULT_MODEL) File “INPUT_NETWORK/mrcnn/model.py”, line 1817, in __init__ self.keras_model = self.build(mode=mode, config=config) File “INPUT_NETWORK/mrcnn/model.py”, line 1921, in build len(config.RPN_ANCHOR_RATIOS), config.TOP_DOWN_PYRAMID_SIZE) File “INPUT_NETWORK/mrcnn/model.py”, line 885, in build_rpn_model outputs = rpn_graph(input_feature_map, anchors_per_location, anchor_stride) File “INPUT_NETWORK/mrcnn/model.py”, line 852, in rpn_graph lambda t: tf.reshape(t, [tf.shape(t)[0], -1, 2]))(x) File “/Users/jasmindalferth/Documents/Mask R-CNN/env/lib/python3.7/site-packages/keras/engine/base_layer.py”, line 457, in __call__ output = self.call(inputs, **kwargs) File “/Users/jasmindalferth/Documents/Mask R-CNN/env/lib/python3.7/site-packages/keras/layers/core.py”, line 687, in call return self.function(inputs, **arguments) File “INPUT_NETWORK/mrcnn/model.py”, line 852, in <lambda> lambda t: tf.reshape(t, [tf.shape(t)[0], -1, 2]))(x) File “/Users/jasmindalferth/Documents/Mask R-CNN/env/lib/python3.7/site-packages/tensorflow/python/ops/array_ops.py”, line 330, in shape return shape_internal(input, name, optimize=True, out_type=out_type) File “/Users/jasmindalferth/Documents/Mask R-CNN/env/lib/python3.7/site-packages/tensorflow/python/ops/array_ops.py”, line 354, in shape_internal input_tensor = ops.convert_to_tensor(input) File “/Users/jasmindalferth/Documents/Mask R-CNN/env/lib/python3.7/site-packages/tensorflow/python/framework/ops.py”, line 1087, in convert_to_tensor return convert_to_tensor_v2(value, dtype, preferred_dtype, name) File “/Users/jasmindalferth/Documents/Mask R-CNN/env/lib/python3.7/site-packages/tensorflow/python/framework/ops.py”, line 1145, in convert_to_tensor_v2 as_ref=False) File “/Users/jasmindalferth/Documents/Mask R-CNN/env/lib/python3.7/site-packages/tensorflow/python/framework/ops.py”, line 1224, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File “/Users/jasmindalferth/Documents/Mask R-CNN/env/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py”, line 305, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File “/Users/jasmindalferth/Documents/Mask R-CNN/env/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py”, line 246, in constant allow_broadcast=True) File “/Users/jasmindalferth/Documents/Mask R-CNN/env/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py”, line 284, in _constant_impl allow_broadcast=allow_broadcast)) File “/Users/jasmindalferth/Documents/Mask R-CNN/env/lib/python3.7/site-packages/tensorflow/python/framework/tensor_util.py”, line 562, in make_tensor_proto “supported type.” % (type(values), values)) TypeError: Failed to convert object of type <class ‘plaidml.tile.Value’> to Tensor. Contents: Add FLOAT32(<tile.Value SymbolicDim UINT64()>, <tile.Value Add FLOAT64()>, <tile.Value Add FLOAT64()>, 6). Consider casting elements to a supported type.

diyessi commented 4 years ago

We removed PlaidML support. PlaidML is working in an MLIR setting now.

jasdal365 commented 4 years ago

So do you know a method how to run tensorflow-gpu on a Mac with the GPU AMD Radeon Pro 5300M?

Gerzer commented 4 years ago

So do you know a method how to run tensorflow-gpu on a Mac with the GPU AMD Radeon Pro 5300M?

I don't think that there's any way to do that now. I'm seriously disappointed that nGraph removed PlaidML support so prematurely. It's irresponsible; they should've at the very least waited until PlaidML's MLIR support was actually functional; right now, it's a long way off.

diyessi commented 4 years ago

The PlaidML team implemented it and was maintaining it and were directed to focus on other things. The backend stopped working with the available PlaidML version many months ago.