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

Fix the bug of conv2d #8551

Merged
merged 6 commits into from
Feb 26, 2018
Merged

Conversation

chengduoZH
Copy link
Contributor

fix #8546

@@ -1262,7 +1262,7 @@ def conv2d(input,
raise ValueError("use_cudnn should be True or False")

input_shape = input.shape
filter_shape = [num_filters, num_filter_channels] + filter_size
filter_shape = [num_filters, num_filter_channels] + list(filter_size)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add an "elif" after line 1256 to convert to list when it's a tuple? And throw a readable error for other unsupported types?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your advice, I think we should define a convert_to_list function in layers/utils.py, just like what tensorflow does.

@@ -1434,29 +1433,24 @@ def sequence_last_step(input):
def pool2d(input,
pool_size,
Copy link
Contributor

@qingqing01 qingqing01 Feb 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pool_size also needs to be set None by default, since if set global_pooling = True, there is no need to set pool_size.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

# limitations under the License.


def convert_to_list(value, n, name):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe called "convert_to_int_list"? Since it only supports int types? Or make the function more general to other types?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! convert_to_list can be written more generally, it can convert any numerical type to a list.

@chengduoZH chengduoZH merged commit 087d8e7 into PaddlePaddle:develop Feb 26, 2018
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

Successfully merging this pull request may close these issues.

Fluid conv2d中存在bug
3 participants