Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

error during trainig phase of unet

owaisali
Novice
531 Views

Fitting model with training data ...
------------------------------
WARNING:tensorflow:From /home/owais/anaconda3/envs/decathlon/lib/python3.6/site-packages/tensorflow_core/python/data/util/random_seed.py:58: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
WARNING:tensorflow:OMP_NUM_THREADS is no longer used by the default Keras config. To configure the number of threads, use tf.config.threading APIs.
Traceback (most recent call last):
  File "train.py", line 170, in <module>
    args.batch_size, args.epochs)
  File "train.py", line 141, in train_and_predict
    callbacks=model_callbacks)
  File "/home/owais/anaconda3/envs/decathlon/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training.py", line 727, in fit
    use_multiprocessing=use_multiprocessing)
  File "/home/owais/anaconda3/envs/decathlon/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training_arrays.py", line 675, in fit
    steps_name='steps_per_epoch')
  File "/home/owais/anaconda3/envs/decathlon/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training_arrays.py", line 169, in model_iteration
    ins = _prepare_feed_values(model, inputs, targets, sample_weights, mode)
  File "/home/owais/anaconda3/envs/decathlon/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training_arrays.py", line 535, in _prepare_feed_values
    extract_tensors_from_dataset=True)
  File "/home/owais/anaconda3/envs/decathlon/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training.py", line 2471, in _standardize_user_data
    exception_prefix='input')
  File "/home/owais/anaconda3/envs/decathlon/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training_utils.py", line 517, in standardize_input_data
    standardize_single_array(x, shape) for (x, shape) in zip(data, shapes)
  File "/home/owais/anaconda3/envs/decathlon/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training_utils.py", line 517, in <listcomp>
    standardize_single_array(x, shape) for (x, shape) in zip(data, shapes)
  File "/home/owais/anaconda3/envs/decathlon/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training_utils.py", line 442, in standardize_single_array
    if (x.shape is not None and len(x.shape) == 1 and
  File "/home/owais/anaconda3/envs/decathlon/lib/python3.6/site-packages/tensorflow_core/python/framework/tensor_shape.py", line 827, in __len__
    raise ValueError("Cannot take the length of shape with unknown rank.")
ValueError: Cannot take the length of shape with unknown rank.

0 Kudos
2 Replies
Munesh_Intel
Moderator
516 Views

Hi Owais,

Thanks for reaching out to us.

The error ValueError: Cannot take the length of shape with unknown rank has been reported as a bug in tensorflow.keras module, as mentioned in the following thread:

https://github.com/tensorflow/tensorflow/issues/24520

 

The issue is resolved by upgrading to TensorFlow 2.2

 

For more information, please refer to the following comments:

https://github.com/tensorflow/tensorflow/issues/24520#issuecomment-626996164

https://github.com/tensorflow/tensorflow/issues/24520#issuecomment-648379484

https://github.com/tensorflow/tensorflow/issues/24520#issuecomment-657492545

 

Regards,

Munesh


0 Kudos
Munesh_Intel
Moderator
508 Views

Hi Owais,

This thread will no longer be monitored since we have provided a solution and references. If you need any additional information from Intel, please submit a new question.


Regards,

Munesh


0 Kudos
Reply