Abdomen-CT-Image-Segmentation
Abdomen-CT-Image-Segmentation copied to clipboard
Update request for requirements file: batchgenerators>=0.19.3 should be batchgenerators==0.19.3
I got longer error while following the readme and running python3 experiment_planning/plan_and_preprocess_task.py -t TaskXXX_Pancreas -p X
. The error end with:
TypeError: resize_segmentation() got an unexpected keyword argument 'cval'
Copying the full error below for reference.
Turns out the error was due to the cval argument being removed in the latest version of batchgenerators which was install since the requirements file has: batchgenerators>=0.19.3
I think this should be updated to simply: batchgenerators==0.19.3
The full error which was fixed by this change is:
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/homes/kovacs/anaconda3/envs/tureckova_dgk1/lib/python3.9/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/homes/kovacs/anaconda3/envs/tureckova_dgk1/lib/python3.9/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "/homes/kovacs/project_scripts/hnc_segmentation/tureckova/Abdomen-CT-Image-Segmentation/nnunet/preprocessing/preprocessing.py", line 270, in _run_star
data, seg, properties = self.resample_and_normalize(data, target_spacing,
File "/homes/kovacs/project_scripts/hnc_segmentation/tureckova/Abdomen-CT-Image-Segmentation/nnunet/preprocessing/preprocessing.py", line 204, in resample_and_normalize
data, seg = resample_patient(data, seg, np.array(properties["original_spacing"]), target_spacing, 3, 1,
File "/homes/kovacs/project_scripts/hnc_segmentation/tureckova/Abdomen-CT-Image-Segmentation/nnunet/preprocessing/preprocessing.py", line 83, in resample_patient
seg_reshaped = resample_data_or_seg(seg, new_shape, True, axis, order_seg, do_separate_z, cval=cval_seg,
File "/homes/kovacs/project_scripts/hnc_segmentation/tureckova/Abdomen-CT-Image-Segmentation/nnunet/preprocessing/preprocessing.py", line 131, in resample_data_or_seg
reshaped_data.append(resize_fn(data[c, slice_id], new_shape_2d, order, cval=cval, **kwargs))
TypeError: resize_segmentation() got an unexpected keyword argument 'cval'
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/homes/kovacs/project_scripts/hnc_segmentation/tureckova/Abdomen-CT-Image-Segmentation/nnunet/experiment_planning/plan_and_preprocess_task.py", line 236, in
Simply did
pip uninstall batchgenerators
pip install batchgenerators==0.19.3
and the function stopped producing this error.