EdwardSmith1884 / 3D-IWGAN

A repository for the paper "Improved Adversarial Systems for 3D Object Generation and Reconstruction".
MIT License
195 stars 56 forks source link

when I run the model .the error happened : #8

Closed AmyWan closed 6 years ago

AmyWan commented 6 years ago

TypeError: Input 'input_sizes' of 'Conv3DBackpropInputV2' Op has type float32 that does not match expected type of int32.

EdwardSmith1884 commented 6 years ago

@AmyWan could you give the entire error output so I can see where in the code this happened?

AmyWan commented 6 years ago

thank your reply.I am very happy.The question is that the network in G,the function in model.py called generator_20. ( net_2 = Deconv(net_1, gf_dim, half,'2', batch_size)),it stoped and had the error printed in the console (Input 'input_sizes' of 'Conv3DBackpropInputV2' Op has type float32 that does not match expected type of int32.)

AmyWan commented 6 years ago

Using TensorFlow backend. WARNING:tensorflow:From C:\Users\WXX\Desktop\tf3D\scripts\models.py:65: set_name_reuse (from tensorlayer.layers.core) is deprecated and will be removed after 2018-06-30. Instructions for updating: TensorLayer relies on TensorFlow to check name reusing. [TL] this method is DEPRECATED and has no effect, please remove it from your code. [TL] InputLayer gen/g/net_0/in: (256, 200) [TL] DenseLayer g/net_1/dense: 2048 identity [TL] ReshapeLayer gen/g/net_1/reshape: (256, 2, 2, 2, 256) [TL] BatchNormLayer g/net_1/batch_norm: decay:0.900000 epsilon:0.000010 act:identity is_train:True [TL] DeConv3dLayer g/net_2/deconv: shape:[4, 4, 4, 128.0, 256] out_shape:[256, 4, 4, 4, 128.0] strides:[1, 2, 2, 2, 1] pad:SAME act:identity Traceback (most recent call last): File "E:\Python35\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 510, in _apply_op_helper preferred_dtype=default_dtype) File "E:\Python35\lib\site-packages\tensorflow\python\framework\ops.py", line 926, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "E:\Python35\lib\site-packages\tensorflow\python\framework\ops.py", line 774, in _TensorTensorConversionFunction (dtype.name, t.dtype.name, str(t))) ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: 'Tensor("gen/g/net_2/deconv/conv3d_transpose/output_shape:0", shape=(5,), dtype=float32)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:/Users/WXX/Desktop/tf3D/32-3D-Gan.py", line 45, in net_g , G_train = generator_32(z, is_train=True, reuse = False, sig= True, batch_size=args.batchsize) File "C:\Users\WXX\Desktop\tf3D\scripts\models.py", line 74, in generator_32 net_2 = Deconv(net_1, gf_dim, eighth, '2', batchsize) File "C:\Users\WXX\Desktop\tf3D\scripts\models.py", line 20, in Deconv act=tf.identity, name='g/net' + net + '/deconv') File "E:\Python35\lib\site-packages\tensorlayer\deprecation.py", line 24, in wrapper return f(*args, **kwargs) File "E:\Python35\lib\site-packages\tensorlayer\layers\convolution.py", line 543, in init tf.nn.conv3d_transpose(self.inputs, W, output_shape=output_shape, strides=strides, padding=padding) File "E:\Python35\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 1428, in conv3d_transpose name=name) File "E:\Python35\lib\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 1083, in conv3d_backprop_input_v2 data_format=data_format, name=name) File "E:\Python35\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 533, in _apply_op_helper (prefix, dtypes.as_dtype(input_arg.type).name)) TypeError: Input 'input_sizes' of 'Conv3DBackpropInputV2' Op has type float32 that does not match expected type of int32.

AmyWan commented 6 years ago

could you help me ?

EdwardSmith1884 commented 6 years ago

If I had to guess this is a version issue for TensorFlow. Did you manage to find a solution?

AmyWan commented 6 years ago

thank your reply,I am so appreciate.I had tried many versions,and finally find that python version caused the error.So I changed the code the function Deconv()in modes.py,like this ,f_dim_out=int(f_dim_out/2),it worked.