tSchlegl / f-AnoGAN

Code for reproducing f-AnoGAN training and anomaly scoring
MIT License
247 stars 64 forks source link

run the wganp_64x64.py #6

Open lzzlxxlsz opened 5 years ago

lzzlxxlsz commented 5 years ago

when I run the .py,there are sonme errors:

Traceback (most recent call last): File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\framework\common_shapes.py", line 686, in _call_cpp_shape_fn_impl input_tensors_as_shapes, status) File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 473, in exit c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimensions must be equal, but are 8 and 512 for 'Generator/Generator.Res1.Shortcut/Conv2D' (op: 'Conv2D') with input shapes: [64,512,8,8], [1,1,512,512].

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:/Users/LZZ/Downloads/f-AnoGAN-master/f-AnoGAN-master/wgangp_64x64.py", line 444, in train() File "C:/Users/LZZ/Downloads/f-AnoGAN-master/f-AnoGAN-master/wgangp_64x64.py", line 263, in train fake_data = Generator(BATCH_SIZE//len(DEVICES), rand_sampling=RAND_SAMPLING, is_training=True) File "C:/Users/LZZ/Downloads/f-AnoGAN-master/f-AnoGAN-master/wgangp_64x64.py", line 175, in GoodGenerator output = ResidualBlock('Generator.Res1', 8dim, 8dim, 3, output, is_training=is_training, resample='up') File "C:/Users/LZZ/Downloads/f-AnoGAN-master/f-AnoGAN-master/wgangp_64x64.py", line 145, in ResidualBlock he_init=False, biases=True, inputs=inputs) File "C:/Users/LZZ/Downloads/f-AnoGAN-master/f-AnoGAN-master/wgangp_64x64.py", line 119, in UpsampleConv output = lib.ops.conv2d.Conv2D(name, input_dim, output_dim, filter_size, output, he_init=he_init, biases=biases) File "C:\Users\LZZ\Downloads\f-AnoGAN-master\f-AnoGAN-master\tflib\ops\conv2d.py", line 147, in Conv2D data_format='NHWC' File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 725, in conv2d data_format=data_format, dilations=dilations, name=name) File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 3162, in create_op compute_device=compute_device) File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 3208, in _create_op_helper set_shapes_for_outputs(op) File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 2427, in set_shapes_for_outputs return _set_shapes_for_outputs(op) File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 2400, in _set_shapes_for_outputs shapes = shape_func(op) File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 2330, in call_with_requiring return call_cpp_shape_fn(op, require_shape_fn=True) File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\framework\common_shapes.py", line 627, in call_cpp_shape_fn require_shape_fn) File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\framework\common_shapes.py", line 691, in _call_cpp_shape_fn_impl raise ValueError(err.message) ValueError: Dimensions must be equal, but are 8 and 512 for 'Generator/Generator.Res1.Shortcut/Conv2D' (op: 'Conv2D') with input shapes: [64,512,8,8], [1,1,512,512].

thanks for all of your help

murielmazzetto commented 5 years ago

What are the sizes of the images that you are using for training?

lzzlxxlsz commented 5 years ago

64*64,but I use the cpu for training

Sushmab27 commented 4 years ago

ValueError: Dimensions must be equal, but are 8 and 512 for 'Generator/Generator.Res1.Shortcut/Conv2D' (op: 'Conv2D') with input shapes: [64,512,8,8], [1,1,512,512].

I am also getting the same error while running wganp_64x64.py

Could anyone help please