LordLiang/DrawingSpinUp

ValueError: invalid palette size

Opened this issue · 1 comments

(drawingspinup) ubuntu@ubuntu-System-Product-Name:/media/ubuntu/94d4241f-301c-46e1-95d0-41a2319d9fc9/DrawingSpinUp/3_style_translator$ python gif_writer.py --uid ff7ab74a67a443e3bda61e69577f4e80
jumping res_stage2_mask_pos_edge
Traceback (most recent call last):
File "/media/ubuntu/94d4241f-301c-46e1-95d0-41a2319d9fc9/DrawingSpinUp/3_style_translator/gif_writer.py", line 30, in
frames[0].save(save_fn, save_all=True, append_images=frames[1:], duration=30, disposal=2, loop=0)
File "/home/ubuntu/anaconda3/envs/drawingspinup/lib/python3.9/site-packages/PIL/Image.py", line 2605, in save
save_handler(self, fp, filename)
File "/home/ubuntu/anaconda3/envs/drawingspinup/lib/python3.9/site-packages/PIL/GifImagePlugin.py", line 774, in _save_all
_save(im, fp, filename, save_all=True)
File "/home/ubuntu/anaconda3/envs/drawingspinup/lib/python3.9/site-packages/PIL/GifImagePlugin.py", line 787, in _save
if not save_all or not _write_multiple_frames(im, fp, palette):
File "/home/ubuntu/anaconda3/envs/drawingspinup/lib/python3.9/site-packages/PIL/GifImagePlugin.py", line 700, in _write_multiple_frames
background_im.putpalette(im_frames[0].im.palette)
File "/home/ubuntu/anaconda3/envs/drawingspinup/lib/python3.9/site-packages/PIL/Image.py", line 2103, in putpalette
self.load() # install new palette
File "/home/ubuntu/anaconda3/envs/drawingspinup/lib/python3.9/site-packages/PIL/Image.py", line 909, in load
self.im.putpalette(self.palette.mode, mode, arr)
ValueError: invalid palette size

进行到最后一步gif_writer的时候报错,请问是什么原因呢,之前的流程都是跟着示例走的

你好,请问res_stage2_mask_pos_edge文件夹下是否已经有结果生成?最后一步只是将图片转为gif,不是很重要。如果已经生成图片,可以尝试别的方法将图片转为video或者gif。