I’m working through fastbook chapter 6, using the Facial Keypoints Dataset on Kaggle.
I’ve manipulated the data a little, converting the tensors to images and saving them down so I can use transforms later. When I use the following DataBlock, everything works correctly and trains well.
data = DataBlock(
blocks=(ImageBlock, PointBlock),
get_x=ColReader(‘fname’),
get_y=ColReader([‘nose_tip_x’,‘nose_tip_y’])
)
However, when I try to add additional PointBlocks I get some errors. The DataBlock runs fine, so does the subsequent set up of Dataloaders. dls.show_batch()
also runs, and shows the points in the correct positions.
xb,yb = dls.one_batch()
gives the following error: ValueError: too many values to unpack (expected 2)
When I try to train I get the error TypeError: 'L' object is not callable
Here is the troublesome DataBlock set up…
data = DataBlock(
blocks=(ImageBlock, PointBlock, PointBlock, PointBlock),
get_x=ColReader('fname'),
get_y=[ColReader(['nose_tip_x','nose_tip_y']),
ColReader(['left_eye_center_x','left_eye_center_y']),
ColReader(['right_eye_center_x','right_eye_center_y'])],
n_inp=1
)
I feel like i’m making a simple error in the way i’m structuring get_y
, but after much googling and trial and error, i’ve been unable to make progress. Any help much appreciated.