Unable to get vision_learner with PointBlock to detect center of squares

Hello back here after a while. Definitely doing smth stupid, please help.

Dataset x is just 512x512 bw images with small squares in the center. y is x & y coordinates of the squares. Entire dataset is the identical image.

Here is how it looks:

I’m repurposing the Points example from vision tutorial.

Here’s the code

path = Path("./target")
fnames = get_image_files(path)
def get_y(fname):
    fname = fname.with_suffix('.csv')
    return [c for xs in common.get_vertices(fname) for x in xs for c in x]
blocks = (ImageBlock, PointBlock)
splitter = TrainTestSplitter(test_size=0.25)
dblock = DataBlock(blocks=blocks, get_items=get_image_files, get_y=get_y, splitter=splitter)
dsets = dblock.datasets(path)
dls = dblock.dataloaders(path, bs=64) # This seems fine, see pic above.
learn = vision_learner(dls, models.resnet18, y_range=(0,1)) # tried with -1,1 as well.
learn.lr_find() # curve seems fine, point picked is just before descent accelerates
learn.fine_tune(5, 0.0003981071640737355)

train_loss seems fine, valid_loss never changes


as you can see, smth is busted


This is basically the barebone version of what I’m trying to do (most I can think of anyways). Any idea what could be going wrong? What else can I try to zero in on the issue?

Thanks for your help : )