MedAugment报错:
Traceback (most recent call last):
File "/disk2/ccc/Github/Medaugment/medaugment.py", line 234, in <module>
main()
File "/disk2/ccc/Github/Medaugment/medaugment.py", line 230, in main
generate_datasets(**vars(args))
File "/disk2/ccc/Github/Medaugment/medaugment.py", line 218, in generate_datasets
med_augment(data_path, name, level, number_branch, mask_i=True)
File "/disk2/ccc/Github/Medaugment/medaugment.py", line 162, in med_augment
transformed = img_transform(image=image, mask=mask.astype(np.uint8))
File "/home/ccc/miniconda3/envs/net/lib/python3.6/site-packages/albumentations/core/composition.py", line 205, in __call__
data = t(**data)
File "/home/ccc/miniconda3/envs/net/lib/python3.6/site-packages/albumentations/core/transforms_interface.py", line 118, in __call__
return self.apply_with_params(params, **kwargs)
File "/home/ccc/miniconda3/envs/net/lib/python3.6/site-packages/albumentations/core/transforms_interface.py", line 131, in apply_with_params
res[key] = target_function(arg, **dict(params, **target_dependencies))
File "/home/ccc/miniconda3/envs/net/lib/python3.6/site-packages/albumentations/augmentations/transforms.py", line 973, in apply
return F.posterize(image, num_bits)
File "/home/ccc/miniconda3/envs/net/lib/python3.6/site-packages/albumentations/augmentations/utils.py", line 107, in wrapped_function
result = func(img, *args, **kwargs)
File "/home/ccc/miniconda3/envs/net/lib/python3.6/site-packages/albumentations/augmentations/functional.py", line 217, in posterize
raise TypeError("Image must have uint8 channel type")
TypeError: Image must have uint8 channel type
查看posterize的文档:
这个类型就只能是unit8,由于医疗图像是float32,所以只能去掉它
标签:TypeError,albumentations,envs,Image,py,File,line,ccc From: https://www.cnblogs.com/BlogLwc/p/17571726.html