While predicting a solution for a sudoku puzzle using CNN, the target variable should predict values from 1 to 9 for all the 81(9*9) values in the puzzle. Hence the target value shape is (81,9). Using keras.to_categorical to convert target variable from (81,1) to (81,9) shows error.
to_categorical takes argument y which must contain integers from 0 to num_classes whereas 0 is not included in the target variable considered here. It works fine when num_classes is taken as 10 but results in (81*10) shaped variable. Is there any other way to get the target variable as (81,9) without altering the target variable values?