Open YiLin-Zhou opened 3 days ago
@YiLin-Zhou Thanks for moving the issue. So the reason this is happening is because you're using multiple anchors for the crops in your train dataset.
dataset:
train_dataset:
slp_files: ["/Users/ylzhou/Documents/DREEM/larva_dreem_100examples_dataset/train/CC24.1_fr1-30.slp", ...]
video_files: ["/Users/ylzhou/Documents/DREEM/larva_dreem_100examples_dataset/train/cc18.4_fr1-30.avi", ...]
padding: 5
crop_size: 105
chunk: false
anchors: ["gut1", "gut2"]
handle_missing: "centroid"
The way that the anchors
argument works with sleap files is that for each anchor/node in the list we create a node-centered crop for that anchor and then concatenate them along the channels dimension. Thus, the image input into the model is really $(n{frames}, 3n{anchors}, h, w)$. In order to resolve this you can either
model.encoder_cfg
set in_chans
to $3 \cdot n_{nodes}$ so in your case it would be
model:
ckpt_path: null
encoder_cfg:
model_name: "resnet18"
backend: "timm"
in_chans: 6 # was 3 before
By the way I noticed in your val_dataset
and test_dataset
you didn't specify any anchors. This will also cause an issue but for the other way around. ie the img crops will only have shape $(n{frames}, 3, h, w)$ but your model would expect inputs with shape $(n{frames}, 6, h, w)$. Also in this case your model will be validated on the images centered around the pose centroid rather than the anchor you wanted as the default when anchors
is not specified is the centroid of the pose
Bug description
Running
dreem-train
on SLEAP data results in this error log:My config files: