title: could not create a view primitive descriptor, in file tensorflow/core/kernels/mkl_slice_op
body: <p>This question is an extension to <a href="https://stackoverflow.com/questions/59842712/a-concatenate-layer-should-be-called-on-a-list-of-at-least-2-inputs/59843479#59843479">A &#39;Concatenate&#39; layer should be called on a list of at least 2 inputs</a>. Please read that first.</p>
  
  <p>I am now receiving the above error when using multiple 
  op 'layers'. Strangely, my code works when I use just 1 op 
   'layer', and I don't know why.</p>
  
  <p>Code:</p>
  
  <pre><code>#Import statements
  import random
  import numpy as np
  from tensorflow import keras
  import tensorflow as tf
  from tensorflow.keras import layers as L
  from collections import deque
  from scipy.special import spence
  
  #Op and conv functions
  def op(x, units, kernel, stride, activation):
      x_list = []
      for i in range(units):
          x_list.append(L.Conv2D(1, kernel, stride, activation=activation)(x))
      x = L.Concatenate(-1)(x_list)
  
      return x
  
  def conv(x, units, kernel, stride, activation):
      x = L.Conv2D(units, kernel, stride, activation=activation)(x)
      return x
  
  #Build_model function
      def build_model(self):
          inputx = L.Input(shape=self.state_size)
          goalx = L.Input(shape=self.state_size)
          x = L.Concatenate(-1)([goalx, inputx])
          x = conv(x, 4, (5,5), (1,1), activation=swish)
          x = op(x, 4, (5,5), (1,1), activation=swish)
          x = op(x, 4, (5,5), (2,2), activation=swish)
          x = op(x, 4, (5,5), (2,2), activation=swish)
          x = op(x, 4, (5,5), (1,1), activation=swish)
          x = op(x, 2, (5,5), (1,1), activation=swish)
          x = op(x, 2, (5,5), (1,1), activation=swish)
          x = op(x, 2, (5,5), (1,1), activation=swish)
          x = L.Flatten()(x)
          outp = L.Dense(self.action_size, activation='softmax')(x)
          valp = L.Dense(1)(x)
          model = keras.models.Model([inputx, goalx], outp)
          critic = keras.models.Model([inputx, goalx], valp)
          model.compile(loss='msle', optimizer='adam')
          critic.compile(loss='msle', optimizer='adam')
          return model, critic
  </code></pre>
  
  <p>Traceback:</p>
  
  <pre><code>2020-01-22 00:12:23.373959: W tensorflow/core/framework/op_kernel.cc:1622] OP_REQUIRES failed at mkl_slice_op.cc:436 : Aborted: Operation received an exception:Status: 5, message: could not create a view primitive descriptor, in file tensorflow/core/kernels/mkl_slice_op.cc:433
  2020-01-22 00:12:23.374013: W tensorflow/core/common_runtime/base_collective_executor.cc:216] BaseCollectiveExecutor::StartAbort Aborted: Operation received an exception:Status: 5, message: could not create a view primitive descriptor, in file tensorflow/core/kernels/mkl_slice_op.cc:433
       [[{{node Slice_3}}]]
  Traceback (most recent call last):
    File "thoughtform.py", line 76, in &lt;module&gt;
      main_loop()
    File "thoughtform.py", line 70, in main_loop
      dqn.replay(1)
    File "/home/ai/Projects/Thoughtforms/dqn.py", line 75, in replay
      self.model.fit(state, advantage, epochs=1, verbose=0)
    File "/home/ai/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py", line 728, in fit
      use_multiprocessing=use_multiprocessing)
    File "/home/ai/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_v2.py", line 324, in fit
      total_epochs=epochs)
    File "/home/ai/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_v2.py", line 123, in run_one_epoch
      batch_outs = execution_function(iterator)
    File "/home/ai/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_v2_utils.py", line 86, in execution_function
      distributed_function(input_fn))
    File "/home/ai/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/eager/def_function.py", line 457, in __call__
      result = self._call(*args, **kwds)
    File "/home/ai/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/eager/def_function.py", line 520, in _call
      return self._stateless_fn(*args, **kwds)
    File "/home/ai/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py", line 1823, in __call__
      return graph_function._filtered_call(args, kwargs)  # pylint: disable=protected-access
    File "/home/ai/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py", line 1141, in _filtered_call
      self.captured_inputs)
    File "/home/ai/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py", line 1224, in _call_flat
      ctx, args, cancellation_manager=cancellation_manager)
    File "/home/ai/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py", line 511, in call
      ctx=ctx)
    File "/home/ai/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/eager/execute.py", line 67, in quick_execute
      six.raise_from(core._status_to_exception(e.code, message), None)
    File "&lt;string&gt;", line 3, in raise_from
  tensorflow.python.framework.errors_impl.AbortedError:  Operation received an exception:Status: 5, message: could not create a view primitive descriptor, in file tensorflow/core/kernels/mkl_slice_op.cc:433
       [[node Slice_3 (defined at /home/ai/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py:1751) ]] [Op:__inference_distributed_function_4600]
  </code></pre>