HsinYingLee / DRIT

Learning diverse image-to-image translation from unpaired data
844 stars 155 forks source link

Error #14

Closed redhat12345 closed 6 years ago

redhat12345 commented 6 years ago

Hi, I am getting the following error. How can solve this? Thanks in advance.

--- train --- /home/mahfuj/drit_virtual/lib/python3.5/site-packages/torch/nn/functional.py:1006: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead. warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.") Traceback (most recent call last): File "/home/mahfuj/drit_virtual/lib/python3.5/site-packages/PIL/Image.py", line 2460, in fromarray mode, rawmode = _fromarray_typemap[typekey] KeyError: ((1, 1, 438), '|u1')

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "train.py", line 78, in main() File "train.py", line 56, in main saver.write_display(total_it, model) File "/media/user/DATA/wacv_round2/DRIT/src/saver.py", line 55, in write_display self.writer.add_image('Image', image_dis, total_it) File "/home/user/drit_virtual/lib/python3.5/site-packages/tensorboardX/writer.py", line 412, in add_image self.file_writer.add_summary(image(tag, img_tensor), global_step, walltime) File "/home/user/drit_virtual/lib/python3.5/site-packages/tensorboardX/summary.py", line 205, in image image = make_image(tensor, rescale=rescale) File "/home/user/drit_virtual/lib/python3.5/site-packages/tensorboardX/summary.py", line 243, in make_image image = Image.fromarray(tensor) File "/home/user/drit_virtual/lib/python3.5/site-packages/PIL/Image.py", line 2463, in fromarray raise TypeError("Cannot handle this data type") TypeError: Cannot handle this data type

hytseng0509 commented 6 years ago

What's your Pytorch, TensorboardX, PIL Image version?

XuYunqiu commented 6 years ago

Hello there I also have the same issue I use torch=0.41, tensorboardX=1.4, pillow=5.2 in windows with python3.6

hytseng0509 commented 6 years ago

Thanks for pointing out the problem. We have fixed the corresponding code.

XuYunqiu commented 6 years ago

Thanks a lot for your generous help :)