You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using my owner datasets to train a model by the stylegan3 code. The datasets are gray images. I have trained a model and want to use the generate_images file to generate samples. But it can't work when I run the code. The information is followed.
error:
Loading networks from "../input/afhqv2model/network-snapshot-000270.pkl"...
Generating image for seed 0 (0/1) ...
Setting up PyTorch plugin "bias_act_plugin"... Done.
Setting up PyTorch plugin "filtered_lrelu_plugin"... Done.
Traceback (most recent call last):
File "../input/stylegan3pytorch/stylegan3-main/gen_images.py", line 143, in
generate_images() # pylint: disable=no-value-for-parameter
File "/opt/conda/lib/python3.7/site-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/opt/conda/lib/python3.7/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/opt/conda/lib/python3.7/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/conda/lib/python3.7/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "../input/stylegan3pytorch/stylegan3-main/gen_images.py", line 137, in generate_images
PIL.Image.fromarray(img[0].cpu().numpy(), 'RGB').save(f'{outdir}/seed{seed:04d}.png')
File "/opt/conda/lib/python3.7/site-packages/PIL/Image.py", line 2949, in fromarray
return frombuffer(mode, size, obj, "raw", rawmode, 0, 1)
File "/opt/conda/lib/python3.7/site-packages/PIL/Image.py", line 2876, in frombuffer
return frombytes(mode, size, data, decoder_name, args)
File "/opt/conda/lib/python3.7/site-packages/PIL/Image.py", line 2822, in frombytes
im.frombytes(data, decoder_name, args)
File "/opt/conda/lib/python3.7/site-packages/PIL/Image.py", line 831, in frombytes
raise ValueError("not enough image data")
ValueError: not enough image data
What can I do about that? Thanks for helping me solve the problem.
The text was updated successfully, but these errors were encountered:
This problem has been done! The officially generate image code needs to be updated according to my own trained model. The following is my own modification.
I am using my owner datasets to train a model by the stylegan3 code. The datasets are gray images. I have trained a model and want to use the generate_images file to generate samples. But it can't work when I run the code. The information is followed.
error:
Loading networks from "../input/afhqv2model/network-snapshot-000270.pkl"...
Generating image for seed 0 (0/1) ...
Setting up PyTorch plugin "bias_act_plugin"... Done.
Setting up PyTorch plugin "filtered_lrelu_plugin"... Done.
Traceback (most recent call last):
File "../input/stylegan3pytorch/stylegan3-main/gen_images.py", line 143, in
generate_images() # pylint: disable=no-value-for-parameter
File "/opt/conda/lib/python3.7/site-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/opt/conda/lib/python3.7/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/opt/conda/lib/python3.7/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/conda/lib/python3.7/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "../input/stylegan3pytorch/stylegan3-main/gen_images.py", line 137, in generate_images
PIL.Image.fromarray(img[0].cpu().numpy(), 'RGB').save(f'{outdir}/seed{seed:04d}.png')
File "/opt/conda/lib/python3.7/site-packages/PIL/Image.py", line 2949, in fromarray
return frombuffer(mode, size, obj, "raw", rawmode, 0, 1)
File "/opt/conda/lib/python3.7/site-packages/PIL/Image.py", line 2876, in frombuffer
return frombytes(mode, size, data, decoder_name, args)
File "/opt/conda/lib/python3.7/site-packages/PIL/Image.py", line 2822, in frombytes
im.frombytes(data, decoder_name, args)
File "/opt/conda/lib/python3.7/site-packages/PIL/Image.py", line 831, in frombytes
raise ValueError("not enough image data")
ValueError: not enough image data
What can I do about that? Thanks for helping me solve the problem.
The text was updated successfully, but these errors were encountered: