I’m running into an issue picking the right depth for `tf.one_hot()`

in Step 2.D. When I set the depth to be the same size as the input using `.shape`

, I receive `"ValueError: Cannot convert a partially known Tensorshape to a Tensor: (None, 90)"`

. What can I do resolve this problem?

The model input is a tensor with partially known shape, means there is at least one axis with ‘None’ size, e.g., the first axis is batch size, which is unknown until running (training or predicting) the model. The depth in tf.one_hot() is a scalar, if you want to extract number of classes from input tensor shape, you’ve to extract its last axis value.

Fixed the problem by running the correct variables (out instead of x). Oops!