Get_preds to DataFrame (Submission to Kaggle Question)

I called get_preds and got a tensor for all the predicted data, but am having difficulty converting it into a numpy array in order to save it in a data frame. I’ve tried to convert it into numpy array but it complains about not being 1-dimensional.

Edit:
Kept searching the forums and found this solution:
preds,_ = learn.get_preds(ds_type=DatasetType.Test)
result = preds.numpy()[:, 0]
result

Tensor

Numpy

just check the shape of your preds. Try to flatten it by tensor.view method. You can also use to_np to convert tensor to numpy array.