Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests v0 3 5 #338

Merged
merged 7 commits into from
Nov 13, 2024
Merged

Tests v0 3 5 #338

merged 7 commits into from
Nov 13, 2024

Conversation

pattonw
Copy link
Contributor

@pattonw pattonw commented Nov 13, 2024

Fixed a couple bugs

  1. CNNectome UNet wasn't following the api defined by the Architecture ABC. It was supposed to be returning Coordinate class instances for voxel_size, input_shape etc.
  2. CNNectome UNet had logical errors in the definition of kernel_size_up and down.
  3. New tests was expecting multi channel data for the 2D UNet and single channel for the 3D unet despite always getting single channel data.
  4. fix voxel_size attr in test fixtures

The Architecture superclass says that we should be returning coordinates for these properties
This is important because we regularly use these values in arithmetic where we expect to execute +-*/ element wise
…re robust

If we upsample, we probably want to apply a convolution to finetune the outputs rather than simply upsampling which we could do outside of a network. If we assume a kernel of size (3, 3, 3), it fails for 2D networks that process using kernels of size (1, 3, 3). We now just use the last kernel in the kernel size up. This is a bit more robust.
… during training

Otherwise the BatchNorm breaks
This should probably just be switched to use `funlib.perisistence.prepare_ds`
@pattonw
Copy link
Contributor Author

pattonw commented Nov 13, 2024

There are still some tests failing.
They fall into two categories

  1. (size of tensor a (x) must match the size of tensor b (x//2). This is caused by the upsample test. We have given raw data and gt data at the same resolution, but then asked the model to upsample and compare to the non upsampled gt. We get a resolution mis match and the shapes will not be comparable between upsampled output and non upsampled target.
  2. AssertionError tensor(y). This seems to be caused by an assumption that the weights should change more than some minimum amount in a few test iterations. I'm not sure if this assumption holds.

FAILED tests/operations/test_train.py::test_train_unet[True-True-True-True-gunpowder_trainer-distance_task-six_class_datasplit] - RuntimeError: The size of tensor a (188) must match the size of tensor b (94) at non-singleton dimensi...
FAILED tests/operations/test_train.py::test_train_unet[True-True-True-False-gunpowder_trainer-distance_task-six_class_datasplit] - RuntimeError: The size of tensor a (188) must match the size of tensor b (94) at non-singleton dimensi...
FAILED tests/operations/test_train.py::test_train_unet[True-True-False-True-gunpowder_trainer-distance_task-six_class_datasplit] - AssertionError: tensor(0.)
FAILED tests/operations/test_train.py::test_train_unet[True-False-True-True-gunpowder_trainer-distance_task-six_class_datasplit] - RuntimeError: The size of tensor a (188) must match the size of tensor b (94) at non-singleton dimensi...
FAILED tests/operations/test_train.py::test_train_unet[True-False-True-False-gunpowder_trainer-distance_task-six_class_datasplit] - RuntimeError: The size of tensor a (188) must match the size of tensor b (94) at non-singleton dimensi...
FAILED tests/operations/test_train.py::test_train_unet[True-False-False-True-gunpowder_trainer-distance_task-six_class_datasplit] - AssertionError: tensor(0.)
FAILED tests/operations/test_train.py::test_train_unet[False-True-True-True-gunpowder_trainer-distance_task-six_class_datasplit] - RuntimeError: The size of tensor a (28) must match the size of tensor b (14) at non-singleton dimension 4
FAILED tests/operations/test_train.py::test_train_unet[False-True-True-False-gunpowder_trainer-distance_task-six_class_datasplit] - RuntimeError: The size of tensor a (28) must match the size of tensor b (14) at non-singleton dimension 4
FAILED tests/operations/test_train.py::test_train_unet[False-True-False-True-gunpowder_trainer-distance_task-six_class_datasplit] - AssertionError: tensor(1.1921e-07)
FAILED tests/operations/test_train.py::test_train_unet[False-False-True-True-gunpowder_trainer-distance_task-six_class_datasplit] - RuntimeError: The size of tensor a (28) must match the size of tensor b (14) at non-singleton dimension 4
FAILED tests/operations/test_train.py::test_train_unet[False-False-True-False-gunpowder_trainer-distance_task-six_class_datasplit] - RuntimeError: The size of tensor a (28) must match the size of tensor b (14) at non-singleton dimension 4
FAILED tests/operations/test_train.py::test_train_unet[False-False-False-True-gunpowder_trainer-distance_task-six_class_datasplit] - AssertionError: tensor(5.9605e-08)

@mzouink
Copy link
Member

mzouink commented Nov 13, 2024

nice, can you please review tha changes i did in the tests_v0_3_5 branch

@mzouink mzouink merged commit 080f00a into janelia-cellmap:tests_v0_3_5 Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants