segmentation_models
segmentation_models copied to clipboard
I am training MaskRCNN model and I run into this errorValueError: None values not supported
WARNING:tensorflow:From c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\tensorflow\python\ops\array_ops.py:5049: calling gather (from tensorflow.python.ops.array_ops) with validate_indices is deprecated and will be removed in a future version.
Instructions for updating:
The validate_indices
argument has no effect. Indices are always validated on CPU and never validated on GPU.
ValueError Traceback (most recent call last)
~\Mask_RCNN\mrcnn\model.py in init(self, mode, config, model_dir) 1837 self.model_dir = model_dir 1838 self.set_log_dir() -> 1839 self.keras_model = self.build(mode=mode, config=config) 1840 1841 def build(self, mode, config):
~\Mask_RCNN\mrcnn\model.py in build(self, mode, config) 2044 # normalized coordinates 2045 detections = DetectionLayer(config, name="mrcnn_detection")( -> 2046 [rpn_rois, mrcnn_class, mrcnn_bbox, input_image_meta]) 2047 2048 # Create masks for detections
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\keras\engine\base_layer.py in call(self, *args, **kwargs)
944 if _in_functional_construction_mode(self, inputs, args, kwargs, input_list):
945 return self._functional_construction_call(inputs, args, kwargs,
--> 946 input_list)
947
948 # Maintains info about the Layer.call
stack.
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\keras\engine\base_layer.py in _functional_construction_call(self, inputs, args, kwargs, input_list) 1082 # Check input assumptions set after layer building, e.g. input shape. 1083 outputs = self._keras_tensor_symbolic_call( -> 1084 inputs, input_masks, args, kwargs) 1085 1086 if outputs is None:
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\keras\engine\base_layer.py in _keras_tensor_symbolic_call(self, inputs, input_masks, args, kwargs) 814 return tf.nest.map_structure(keras_tensor.KerasTensor, output_signature) 815 else: --> 816 return self._infer_output_signature(inputs, args, kwargs, input_masks) 817 818 def _infer_output_signature(self, inputs, args, kwargs, input_masks):
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\keras\engine\base_layer.py in _infer_output_signature(self, inputs, args, kwargs, input_masks) 854 self._maybe_build(inputs) 855 inputs = self._maybe_cast_inputs(inputs) --> 856 outputs = call_fn(inputs, *args, **kwargs) 857 858 self._handle_activity_regularization(inputs, outputs)
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\tensorflow\python\autograph\impl\api.py in wrapper(*args, **kwargs) 693 except Exception as e: # pylint:disable=broad-except 694 if hasattr(e, 'ag_error_metadata'): --> 695 raise e.ag_error_metadata.to_exception(e) 696 else: 697 raise
ValueError: in user code:
C:\Users\Owner\Mask_RCNN\mrcnn\model.py:812 call *
detections_batch = utils.batch_slice(
C:\Users\Owner\Mask_RCNN\mrcnn\utils.py:820 batch_slice *
output_slice = graph_fn(*inputs_slice)
C:\Users\Owner\Mask_RCNN\mrcnn\model.py:704 refine_detections_graph *
indices = tf.stack([tf.range(probs.shape[0]), class_ids], axis=1)
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\tensorflow\python\util\dispatch.py:206 wrapper **
return target(*args, **kwargs)
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\tensorflow\python\ops\math_ops.py:1908 range
limit = ops.convert_to_tensor(limit, dtype=dtype, name="limit")
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\tensorflow\python\profiler\trace.py:163 wrapped
return func(*args, **kwargs)
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\tensorflow\python\framework\ops.py:1566 convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\tensorflow\python\framework\constant_op.py:339 _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\tensorflow\python\framework\constant_op.py:265 constant
allow_broadcast=True)
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\tensorflow\python\framework\constant_op.py:283 _constant_impl
allow_broadcast=allow_broadcast))
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\tensorflow\python\framework\tensor_util.py:445 make_tensor_proto
raise ValueError("None values not supported.")
ValueError: None values not supported.
This isn't a repo for MaskRCNN.
This is the demo from MaskRCNN and I keep getting the same error ValueError: None values not supported.
Hi Jordan Pierce,
I am using MaskRCNN repo from Matterpoart on github, this is the error I got from running the demo.
I would appreciate if you have some suggestions on how to go about it.
Thanks, Aida
On Tue, Jun 22, 2021 at 4:57 PM Jordan Pierce @.***> wrote:
This isn't a repo for MaskRCNN.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/qubvel/segmentation_models/issues/481#issuecomment-866328093, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATJZQJ4BNSLGF7AKXUHSVJLTUD2LNANCNFSM47ATBWLA .
--
Aida da Silva
Student at WVU * Major Civil Engineering @.**
Hi @AidaSilva, yes I see that this is code for Matterport's MaskRCNN implementation in Keras, however this repository is qubvel's semantic segmentation repository. It might be more helpful for you to post your issues in Matterport's repo instead.
But since we're already here: looking at the error it seems that something is unutilized and is equal to None
when it should be something else. I'd recommend checking your config
and MODEL_DIR
variables first. It's also possible that you're using different versions of Tensorflow, Keras, and other dependencies that Matterport's code relies on. Can you confirm you're using the correct requirements?
Hi Jordan,
Thank you for writing back to me.
I am using the newest version of tf and Keras. I am able to run the demo. But I am having some issues with configuration as I am trying to train my own data set. I was wondering if you could help me. Here is the error message:
TypeError Traceback (most recent call
last)
Maintains info about the Layer.call
stack.
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\keras\engine\base_layer.py
in _functional_construction_call(self, inputs, args, kwargs,
input_list) 1082 # Check input assumptions set after layer
building, e.g. input shape. 1083 outputs =
self._keras_tensor_symbolic_call(-> 1084 inputs,
input_masks, args, kwargs) 1085 1086 if outputs is None:
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\keras\engine\base_layer.py
in _keras_tensor_symbolic_call(self, inputs, input_masks, args,
kwargs) 814 return
tf.nest.map_structure(keras_tensor.KerasTensor, output_signature)
815 else:--> 816 return self._infer_output_signature(inputs,
args, kwargs, input_masks) 817 818 def
_infer_output_signature(self, inputs, args, kwargs, input_masks):
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\keras\engine\base_layer.py
in _infer_output_signature(self, inputs, args, kwargs, input_masks)
860 build_graph=False) 861
outputs = tf.nest.map_structure(--> 862
keras_tensor.keras_tensor_from_tensor, outputs) 863 864 if
hasattr(self, '_set_inputs') and not self.inputs:
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\tensorflow\python\util\nest.py
in map_structure(func, *structure, **kwargs) 865 866 return
pack_sequence_as(--> 867 structure[0], [func(*x) for x in
entries], 868 expand_composites=expand_composites) 869
c:\users\owner\anaconda3\envs\maskrcnn\lib\site-packages\tensorflow\python\util\nest.py
in
On Wed, Jun 23, 2021 at 10:16 AM Jordan Pierce @.***> wrote:
Hi @AidaSilva https://github.com/AidaSilva, yes I see that this is code for Matterport's MaskRCNN implementation in Keras, however this repository is qubvel's semantic segmentation repository. It might be more helpful for you to post your issues in Matterport's repo instead.
But since we're already here: looking at the error it seems that something is unutilized and is equal to None when it should be something else. I'd recommend checking your config and MODEL_DIR variables first. It's also possible that you're using different versions of Tensorflow, Keras, and other dependencies that Matterport's code relies on. Can you confirm you're using the correct requirements https://github.com/matterport/Mask_RCNN/blob/master/requirements.txt?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/qubvel/segmentation_models/issues/481#issuecomment-866875141, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATJZQJ7Q264KYQD4UVKE52TTUHUFFANCNFSM47ATBWLA .
--
Aida da Silva
Student at WVU * Major Civil Engineering @.**
I user python 11 tf, keras 2.12 It's the same: /content/drive/MyDrive/DoAn/Teeth/Mask-R-CNN-using-Tensorflow2-main/mrcnn/model.py in if_body() 40 nonlocal keep 41 conf_keep = ag__.converted_call(ag__.ld(tf).where, (ag__.ld(class_scores) >= ag__.ld(config).DETECTION_MIN_CONFIDENCE,), None, fscope)[:, 0] ---> 42 keep = ag__.converted_call(ag__.ld(tf).sparse.to_dense, (ag__.converted_call(ag__.ld(tf).expand_dims, (ag__.ld(keep), 0), None, fscope), ag__.converted_call(ag__.ld(tf).expand_dims, (ag__.ld(conf_keep), 0), None, fscope)), None, fscope) 43 keep = ag__.converted_call(ag__.ld(tf).sparse.to_dense, (ag__.ld(keep),), None, fscope)[0] 44
TypeError: Exception encountered when calling layer "mrcnn_detection" (type DetectionLayer).
in user code:
File "/content/drive/MyDrive/DoAn/Teeth/Mask-R-CNN-using-Tensorflow2-main/mrcnn/model.py", line 812, in call *
detections_batch = utils.batch_slice(
File "/content/drive/MyDrive/DoAn/Teeth/Mask-R-CNN-using-Tensorflow2-main/mrcnn/utils.py", line 820, in batch_slice *
output_slice = graph_fn(*inputs_slice)
File "/content/drive/MyDrive/DoAn/Teeth/Mask-R-CNN-using-Tensorflow2-main/mrcnn/model.py", line 721, in refine_detections_graph *
keep = tf.sparse.to_dense(tf.expand_dims(keep, 0),
TypeError: Input must be a SparseTensor.
Call arguments received by layer "mrcnn_detection" (type DetectionLayer): • inputs=['tf.Tensor(shape=(1, None, 4), dtype=float32)', 'tf.Tensor(shape=(1, None, 3), dtype=float32)', 'tf.Tensor(shape=(1, None, 3, 4), dtype=float32)', 'tf.Tensor(shape=(None, 15), dtype=float32)']
Did you fix it yet?