-
Notifications
You must be signed in to change notification settings - Fork 234
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
3 test failling #292
Comments
Hello, If I may add a similar bug that sometimes happens when running the tests with pytest: FAILED transforms/test_transforms.py::TestTransforms::test_transforms_array Coming from the bias field generation transform when a division by 0 occurs @staticmethod
def generate_bias_field(
data: TypeData,
order: int,
coefficients: TypeData,
) -> np.ndarray:
# Create the bias field map using a linear combination of polynomial
# functions and the coefficients previously sampled
shape = np.array(data.shape[1:]) # first axis is channels
half_shape = shape / 2
ranges = [np.arange(-n, n) for n in half_shape]
bias_field = np.zeros(shape)
x_mesh, y_mesh, z_mesh = np.asarray(np.meshgrid(*ranges))
> x_mesh /= x_mesh.max()
E FloatingPointError: divide by zero encountered in true_divide
../torchio/transforms/augmentation/intensity/random_bias_field.py:94: FloatingPointError |
Thank you both for reporting. I agree that I think this is unrelated. It looks like |
Actually I'm not sure about that. In one hand, it's more effective and output will truly equal input if we leave the input untouched when transforms are supposed to have no effect. On the other hand, it shows that the transform somehow behaves properly by not altering the input (or almost) when it is supposed to have no effect. What do you think? |
I think you are right. What's the point of using 0 intensity or 0 spikes anyway? I will just switch to |
Fixed in |
🐛Bug
After un update of my python package I now get error on the following test
FAIL: test_with_zero_intensity (tests.transforms.augmentation.test_random_spike.TestRandomSpike)
FAIL: test_with_zero_spike (tests.transforms.augmentation.test_random_spike.TestRandomSpike)
FAIL: test_no_movement (tests.transforms.augmentation.test_random_motion.TestRandomMotion)
To reproduce
numpy 1.19.1 pypi_0 pypi
numpy-base 1.17.2 py37hde5b4d6_0
numpydoc 1.1.0 py_0
Expected behavior
it is related to fft and fft inverse that now to not get the exact same number
Solution will be to replace
assert_array_equal with des np.all_close
but may be it is due to something wrong in my python package ...
TorchIO version
0.17.34
The text was updated successfully, but these errors were encountered: