Using skimage and fil_finder in measuring the length of skeleton

I’m trying to measure the longest and the transverse branchs of a banana picture, using skimage to get the skeleton and then using fil_finder to get the length of the longest branch , the code is adapted from this post

but i can’t get it fil_finder to work with the skeleton output of skimage, i get the following error:

raise TypeError("Data must be 2D. Please re-check the inputs.")
TypeError: Data must be 2D. Please re-check the inputs.

skeleton made using skimage
banana picture used in code

any help solving the error and updates to code if any needed to measure the length of longest and transverse length

from skimage import io,img_as_float
from skimage.morphology import skeletonize
from matplotlib import pyplot as plt
from skimage.util import invert
import numpy as np
from fil_finder import FilFinder2D
import astropy.units as u


gray = invert(image)

fil = FilFinder2D(skeleton, distance=250 * u.pc, mask=skeleton)
fil.create_mask(border_masking=True, verbose=False,
fil.analyze_skeletons(branch_thresh=40* u.pix, skel_thresh=10 * u.pix, prune_criteria='length')

plt.imshow(fil.skeleton, cmap='gray')
plt.contour(fil.skeleton_longpath, colors='r')