Open lzhzju opened 1 year ago
I am not sure which image is saved, but maybe imageio can only save images with shape (W, H) or (W, H, 3). You can try debug the shape of your output like: print(tensor.numpy().shape) to make sure the output shape is like that.
Another workaround is using opencv to save the image.
Process Process-13: Traceback (most recent call last): File "/home/lzh/anaconda3/envs/SGL/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap self.run() File "/home/lzh/anaconda3/envs/SGL/lib/python3.7/multiprocessing/process.py", line 99, in run self._target(*self._args, self._kwargs) File "/data1/lzh/workspace/retinal-image-segmentation-and-analysis/SGL-Retinal-Vessel-Segmentation/sgl_training/utility.py", line 139, in bg _target imageio.imwrite(filename, tensor.numpy()) File "/home/lzh/anaconda3/envs/SGL/lib/python3.7/site-packages/imageio/v2.py", line 397, in imwrite return file.write(im, kwargs) File "/home/lzh/anaconda3/envs/SGL/lib/python3.7/site-packages/imageio/plugins/pillow.py", line 405, in write raise ValueError("Can't write images with one color channel.") ValueError: Can't write images with one color channel.
Is this issue caused by an inappropriate version of imageio?