hzxie/Pix2Vox

TypeError: Cannot handle this data type: (1, 1, 389), |u1

ShiJunRong opened this issue · 1 comments

Greetings, I faced below error while running runner.py file, any suggestions will be appreciated.

Traceback (most recent call last):
File "/home/rsj/anaconda3/envs/torch14/lib/python3.8/site-packages/PIL/Image.py", line 2751, in fromarray
mode, rawmode = _fromarray_typemap[typekey]
KeyError: ((1, 1, 389), '|u1')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "runner.py", line 93, in
main()
File "runner.py", line 74, in main
train_net(cfg)
File "/home/rsj/DataDisk/Code_and_DataSets/Pix2Vox/Pix2Vox-master/core/train.py", line 265, in train_net
iou = test_net(cfg, epoch_idx + 1, output_dir, val_data_loader, val_writer, encoder, decoder, refiner, merger)
File "/home/rsj/DataDisk/Code_and_DataSets/Pix2Vox/Pix2Vox-master/core/test.py", line 152, in test_net
test_writer.add_image('Test Sample#%02d/Volume Reconstructed' % sample_idx, rendering_views, epoch_idx)
File "/home/rsj/anaconda3/envs/torch14/lib/python3.8/site-packages/tensorboardX/writer.py", line 608, in add_image
image(tag, img_tensor, dataformats=dataformats), global_step, walltime)
File "/home/rsj/anaconda3/envs/torch14/lib/python3.8/site-packages/tensorboardX/summary.py", line 288, in image
image = make_image(tensor, rescale=rescale)
File "/home/rsj/anaconda3/envs/torch14/lib/python3.8/site-packages/tensorboardX/summary.py", line 328, in make_image
image = Image.fromarray(tensor)
File "/home/rsj/anaconda3/envs/torch14/lib/python3.8/site-packages/PIL/Image.py", line 2753, in fromarray
raise TypeError("Cannot handle this data type: %s, %s" % typekey) from e
TypeError: Cannot handle this data type: (1, 1, 389), |u1
[INFO/MainProcess] process shutting down

Is there a workaround? thank you in advance

hzxie commented

Please refer to #14.