zalandoresearch/psgan

Image generating problem

PJeys opened this issue · 0 comments

PJeys commented

Hello everybody!
I am trying to generate some images from pretrained models to see how it works in general. But after calling
python2 demo_generation.py models/honey_filters64_npx161_5gL_5dL_60Global_3Periodic_FalseAffine_30Local_epoch100.psgan

I'm facing an error:

using stored model models/honey_filters64_npx161_5gL_5dL_60Global_3Periodic_FalseAffine_30Local_epoch100.psgan
loading parameters from file: models/honey_filters64_npx161_5gL_5dL_60Global_3Periodic_FalseAffine_30Local_epoch100.psgan
global dimensions of loaded config file 60
Compiling the network...
Discriminator done. (took 13.628841877 s)
Generator done. (took 7.85284900665 s)
generate function done. (took 2.22278308868 s)
nz 96 global Dimensions 60 periodic Dimensions 3
G values [512, 256, 128, 64, 3] [(5, 5), (5, 5), (5, 5), (5, 5), (5, 5)]
D values [3, 64, 128, 256, 512] [(5, 5), (5, 5), (5, 5), (5, 5), (5, 5)]
Traceback (most recent call last):
File "demo_generation.py", line 70, in
sample_texture(psgan)
File "demo_generation.py", line 61, in sample_texture
data = psgan.generate(z_sample)
File "/Users/michaelmedved/Library/Python/2.7/lib/python/site-packages/theano/compile/function_module.py", line 886, in call
storage_map=getattr(self.fn, 'storage_map', None))
File "/Users/michaelmedved/Library/Python/2.7/lib/python/site-packages/theano/gof/link.py", line 325, in raise_with_op
reraise(exc_type, exc_value, exc_trace)
File "/Users/michaelmedved/Library/Python/2.7/lib/python/site-packages/theano/compile/function_module.py", line 873, in call
self.fn() if output_subset is None else
AssertionError: AbstractConv_gradInputs shape mismatch: shape of filters does not match given kshp.
Apply node that caused the error: Assert{msg='AbstractConv_gradInputs shape mismatch: shape of filters does not match given kshp.'}(W, Elemwise{eq,no_inplace}.0, Elemwise{eq,no_inplace}.0, Elemwise{eq,no_inplace}.0, Elemwise{eq,no_inplace}.0)
Toposort index: 72
Inputs types: [TensorType(float64, 4D), TensorType(bool, scalar), TensorType(bool, scalar), TensorType(bool, scalar), TensorType(bool, scalar)]
Inputs shapes: [(96, 512, 5, 5), (), (), (), ()]
Inputs strides: [(102400, 200, 40, 8), (), (), (), ()]
Inputs values: ['not shown', array(False), array(True), array(True), array(True)]
Inputs type_num: [12, 0, 0, 0, 0]
Outputs clients: [[Subtensor{::, ::, ::int64, ::int64}(Assert{msg='AbstractConv_gradInputs shape mismatch: shape of filters does not match given kshp.'}.0, Constant{-1}, Constant{-1})]]

Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer):
File "demo_generation.py", line 64, in
psgan = PSGAN(name=name)
File "/Users/michaelmedved/Development/kaleidoscope/psgan/psgan/psgan.py", line 174, in init
self._build_sgan()
File "/Users/michaelmedved/Development/kaleidoscope/psgan/psgan/psgan.py", line 327, in _build_sgan
prediction_gen = lasagne.layers.get_output(gen_X)
File "/Users/michaelmedved/Library/Python/2.7/lib/python/site-packages/lasagne/layers/helper.py", line 197, in get_output
all_outputs[layer] = layer.get_output_for(layer_inputs, **kwargs)
File "/Users/michaelmedved/Library/Python/2.7/lib/python/site-packages/lasagne/layers/conv.py", line 352, in get_output_for
conved = self.convolve(input, **kwargs)
File "/Users/michaelmedved/Library/Python/2.7/lib/python/site-packages/lasagne/layers/conv.py", line 981, in convolve
conved = op(self.W, input, output_size)

Debugprint of the apply node:
Assert{msg='AbstractConv_gradInputs shape mismatch: shape of filters does not match given kshp.'} [id A] <TensorType(float64, 4D)> ''
|W [id B] <TensorType(float64, 4D)>
|Elemwise{eq,no_inplace} [id C] <TensorType(bool, scalar)> ''
| |Shape_i{0} [id D] <TensorType(int64, scalar)> ''
| | |W [id B] <TensorType(float64, 4D)>
| |TensorConstant{102} [id E] <TensorType(int8, scalar)>
|Elemwise{eq,no_inplace} [id F] <TensorType(bool, scalar)> ''
| |Shape_i{1} [id G] <TensorType(int64, scalar)> ''
| | |W [id B] <TensorType(float64, 4D)>
| |TensorConstant{512} [id H] <TensorType(int16, scalar)>
|Elemwise{eq,no_inplace} [id I] <TensorType(bool, scalar)> ''
| |Shape_i{2} [id J] <TensorType(int64, scalar)> ''
| | |W [id B] <TensorType(float64, 4D)>
| |TensorConstant{5} [id K] <TensorType(int8, scalar)>
|Elemwise{eq,no_inplace} [id L] <TensorType(bool, scalar)> ''
|Shape_i{3} [id M] <TensorType(int64, scalar)> ''
| |W [id B] <TensorType(float64, 4D)>
|TensorConstant{5} [id K] <TensorType(int8, scalar)>

Storage map footprint:

  • Subtensor{::, ::, ::int64, ::int64}.0, Shape: (512, 256, 5, 5), ElemSize: 8 Byte(s), TotalSize: 26214400 Byte(s)
  • W, Shared Input, Shape: (512, 256, 5, 5), ElemSize: 8 Byte(s), TotalSize: 26214400 Byte(s)
  • W, Shared Input, Shape: (96, 512, 5, 5), ElemSize: 8 Byte(s), TotalSize: 9830400 Byte(s)
  • Subtensor{::, ::, ::int64, ::int64}.0, Shape: (256, 128, 5, 5), ElemSize: 8 Byte(s), TotalSize: 6553600 Byte(s)
  • W, Shared Input, Shape: (256, 128, 5, 5), ElemSize: 8 Byte(s), TotalSize: 6553600 Byte(s)
  • input, Input, Shape: (1, 96, 60, 60), ElemSize: 8 Byte(s), TotalSize: 2764800 Byte(s)
  • Subtensor{::, ::, ::int64, ::int64}.0, Shape: (128, 64, 5, 5), ElemSize: 8 Byte(s), TotalSize: 1638400 Byte(s)
  • W, Shared Input, Shape: (128, 64, 5, 5), ElemSize: 8 Byte(s), TotalSize: 1638400 Byte(s)
  • W, Shared Input, Shape: (64, 3, 5, 5), ElemSize: 8 Byte(s), TotalSize: 38400 Byte(s)
  • Subtensor{::, ::, ::int64, ::int64}.0, Shape: (64, 3, 5, 5), ElemSize: 8 Byte(s), TotalSize: 38400 Byte(s)
  • <TensorType(float64, matrix)>, Shared Input, Shape: (60, 50), ElemSize: 8 Byte(s), TotalSize: 24000 Byte(s)
  • <TensorType(float64, matrix)>, Shared Input, Shape: (50, 12), ElemSize: 8 Byte(s), TotalSize: 4800 Byte(s)
  • mean, Shared Input, Shape: (512,), ElemSize: 8 Byte(s), TotalSize: 4096 Byte(s)
  • inv_std, Shared Input, Shape: (512,), ElemSize: 8 Byte(s), TotalSize: 4096 Byte(s)
  • beta, Shared Input, Shape: (512,), ElemSize: 8 Byte(s), TotalSize: 4096 Byte(s)
  • gamma, Shared Input, Shape: (512,), ElemSize: 8 Byte(s), TotalSize: 4096 Byte(s)
  • mean, Shared Input, Shape: (256,), ElemSize: 8 Byte(s), TotalSize: 2048 Byte(s)
  • gamma, Shared Input, Shape: (256,), ElemSize: 8 Byte(s), TotalSize: 2048 Byte(s)
  • inv_std, Shared Input, Shape: (256,), ElemSize: 8 Byte(s), TotalSize: 2048 Byte(s)
  • beta, Shared Input, Shape: (256,), ElemSize: 8 Byte(s), TotalSize: 2048 Byte(s)
  • mean, Shared Input, Shape: (128,), ElemSize: 8 Byte(s), TotalSize: 1024 Byte(s)
  • gamma, Shared Input, Shape: (128,), ElemSize: 8 Byte(s), TotalSize: 1024 Byte(s)
  • inv_std, Shared Input, Shape: (128,), ElemSize: 8 Byte(s), TotalSize: 1024 Byte(s)
  • beta, Shared Input, Shape: (128,), ElemSize: 8 Byte(s), TotalSize: 1024 Byte(s)
  • beta, Shared Input, Shape: (64,), ElemSize: 8 Byte(s), TotalSize: 512 Byte(s)
  • gamma, Shared Input, Shape: (64,), ElemSize: 8 Byte(s), TotalSize: 512 Byte(s)
  • inv_std, Shared Input, Shape: (64,), ElemSize: 8 Byte(s), TotalSize: 512 Byte(s)
  • mean, Shared Input, Shape: (64,), ElemSize: 8 Byte(s), TotalSize: 512 Byte(s)
  • <TensorType(float64, vector)>, Shared Input, Shape: (50,), ElemSize: 8 Byte(s), TotalSize: 400 Byte(s)
  • <TensorType(float64, vector)>, Shared Input, Shape: (12,), ElemSize: 8 Byte(s), TotalSize: 96 Byte(s)
  • b, Shared Input, Shape: (3,), ElemSize: 8 Byte(s), TotalSize: 24 Byte(s)
  • Constant{0}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{32}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • Constant{60}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{(1, 1, 1, ..5307179586}, Shape: (1, 1, 1, 1), ElemSize: 8 Byte(s), TotalSize: 8 Byte(s)
  • TensorConstant{256}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{64}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{-1}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • Constant{-5}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • Constant{1}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • Constant{2}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{(1,) of 0.9}, Shape: (1,), ElemSize: 8 Byte(s), TotalSize: 8 Byte(s)
  • Constant{-6}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{512}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{2}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{128}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{(1,) of 0.1}, Shape: (1,), ElemSize: 8 Byte(s), TotalSize: 8 Byte(s)
  • TensorConstant{6}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{60}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • Constant{3}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{16}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{(1, 1, 1, 1) of 0.5}, Shape: (1, 1, 1, 1), ElemSize: 8 Byte(s), TotalSize: 8 Byte(s)
  • Constant{9}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{(1,) of 0.0001}, Shape: (1,), ElemSize: 8 Byte(s), TotalSize: 8 Byte(s)
  • TensorConstant{1}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • Constant{-1}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{8}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{4}, Shape: (), ElemSize: 8 Byte(s), TotalSize: 8.0 Byte(s)
  • TensorConstant{1.0}, Shape: (), ElemSize: 4 Byte(s), TotalSize: 4.0 Byte(s)
  • TensorConstant{0.0}, Shape: (), ElemSize: 4 Byte(s), TotalSize: 4.0 Byte(s)
  • TensorConstant{256}, Shape: (), ElemSize: 2 Byte(s), TotalSize: 2.0 Byte(s)
  • TensorConstant{128}, Shape: (), ElemSize: 2 Byte(s), TotalSize: 2.0 Byte(s)
  • TensorConstant{512}, Shape: (), ElemSize: 2 Byte(s), TotalSize: 2.0 Byte(s)
  • Elemwise{eq,no_inplace}.0, Shape: (), ElemSize: 1 Byte(s), TotalSize: 1.0 Byte(s)
  • TensorConstant{5}, Shape: (), ElemSize: 1 Byte(s), TotalSize: 1.0 Byte(s)
  • Elemwise{eq,no_inplace}.0, Shape: (), ElemSize: 1 Byte(s), TotalSize: 1.0 Byte(s)
  • Elemwise{eq,no_inplace}.0, Shape: (), ElemSize: 1 Byte(s), TotalSize: 1.0 Byte(s)
  • TensorConstant{102}, Shape: (), ElemSize: 1 Byte(s), TotalSize: 1.0 Byte(s)
  • Elemwise{eq,no_inplace}.0, Shape: (), ElemSize: 1 Byte(s), TotalSize: 1.0 Byte(s)
  • TensorConstant{64}, Shape: (), ElemSize: 1 Byte(s), TotalSize: 1.0 Byte(s)
  • TensorConstant{3}, Shape: (), ElemSize: 1 Byte(s), TotalSize: 1.0 Byte(s)
  • TensorConstant{1}, Shape: (), ElemSize: 1 Byte(s), TotalSize: 1.0 Byte(s)
    TotalSize: 81545079.0 Byte(s) 0.076 GB
    TotalSize inputs: 47100275.0 Byte(s) 0.044 GB

Can you explain please where is the problem and how can it be fixed