Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A problem in src/conv3dTranspose.py #21

Open
RadiantJeral opened this issue Oct 7, 2018 · 3 comments
Open

A problem in src/conv3dTranspose.py #21

RadiantJeral opened this issue Oct 7, 2018 · 3 comments

Comments

@RadiantJeral
Copy link

Hi, I run the test commend "python test.py -data driving_RGB_cleanpass/ -pspath driving_RGB_cleanpass/a-out/ -bs 1 " and I get the problem as follow.
Use shared weight for first stage
Traceback (most recent call last):
File "test.py", line 60, in
Predict()
File "test.py", line 42, in Predict
model = createGCNetwork(hp, tp, True)
File "src/gcnetwork.py", line 167, in createGCNetwork
disp_map = LearnReg(cv, num_filters, ksize, ds_stride, resnet, padding, highway_func, num_down_conv)
File "src/gcnetwork.py", line 114, in LearnReg
deconv = createDeconv3D(up_convs, filters, ksize, ds_stride, padding)
File "src/gcnetwork.py", line 38, in createDeconv3D
deconv = Conv3DTranspose(filters, ksize, stride, padding) (input)
File "/home/lucifer16/venv/local/lib/python2.7/site-packages/keras/engine/base_layer.py", line 457, in call
output = self.call(inputs, **kwargs)
File "src/conv3dTranspose.py", line 237, in call
self.padding)
TypeError: deconv_length() takes at least 5 arguments (4 given)

The problem seems occurs in the line 237 of "src/conv3dTranspose.py".
The code is "out_depth = conv_utils.deconv_length(depth, stride_h, kernel_h, self.padding)". It passes 4 arguments.

But the source code in Keras github about the "conv_utils.deconv_length" is as follows. And it passes 5arguments.

def deconv_length(dim_size, stride_size, kernel_size, padding,
output_padding, dilation=1):
"""Determines output length of a transposed convolution given input length.
# Arguments
dim_size: Integer, the input length.
stride_size: Integer, the stride along the dimension of dim_size.
kernel_size: Integer, the kernel size along the dimension of dim_size.
padding: One of "same", "valid", "full".
output_padding: Integer, amount of padding along the output dimension, Can be set to None in
which case the output length is inferred.
dilation: dilation rate, integer.
link : https://github.com/keras-team/keras/blob/master/keras/utils/conv_utils.py

I use the "Keras==2. 2. 4". Shall I use a older version or any other suggestions?

Your prompt response will be most appreciated.

@IceTTTb
Copy link

IceTTTb commented Oct 25, 2018

Hi, @RadiantJeral : l met the same problem as you. Have you solved it?

@czy341181
Copy link

Hi, @RadiantJeral : l met the same problem as you. Have you solved it?

hi, i also met the same problem , which version should I change keras ? Your prompt response will be most appreciated

@alphaccw
Copy link

alphaccw commented Feb 7, 2019

keras 2.1.6 is fine. Or you can just give the 5th argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants