Tensorflow Conv2d Error

Not found: No algorithm worked!

Mon, Oct 12, 2020

This error occurs when the Conv2D layer input shape doesn’t match what was specified in the actual data. Error text:

I noticed the “Not found: No algorithm worked!” error after changing the order of the data I was passing into the model. From shape=(depth, rows, columns) to shape=(rows,columns,depth).

Unfortunately I missed the change in my parse function, so I was passing in the wrong shape to model.fit().

def parse_element_function:
example = tf.io.parse_single_example(example_proto, feature_description)
    raw_image = example['raw_image']        
    # This line put the indexes in the wrong order!
    image = tf.reshape(raw_image,tf.stack([input_depth,input_rows,input_columns]))  
    return (image,example['label'],example['filename'])
preprocessed_dataset = dataset.map(add_nose)

The interesting thing is that the input layer is expecting the correct shape, but didn’t give an error when the shapes didn’t match.

  inputs = keras.layers.Input(shape=(input_rows,input_columns,input_depth))

  x = inputs
  x = keras.layers.Conv2D(8,(3,3),padding='same',activation='relu')(x)
  ...

This is the error text I was getting from Tensorflow:

Traceback (most recent call last):
  ...
tensorflow.python.framework.errors_impl.NotFoundError: 2 root error(s) found.
  (0) Not found: No algorithm worked!
         [[{{node conv2d_8/Conv2D}}]]
         [[metrics_2/acc/Identity_2/_789]]
  (1) Not found: No algorithm worked!
         [[{{node conv2d_8/Conv2D}}]]
0 successful operations.
0 derived errors ignored.

Tried running in CPU only mode by disabling GPU’s:

(venv) host$ env CUDA_VISIBLE_DEVICES="" python train_model.py 

And got a different error.

Traceback (most recent call last):
  ...
tensorflow.python.framework.errors_impl.UnimplementedError: Fused conv 
  implementation does not support grouped convolutions for now.
         [[{{node conv2d_8/Relu}}]]