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

Support global average pooling #123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BryceCicada
Copy link

@BryceCicada BryceCicada commented Jun 21, 2017

sjain-stanford added a commit to sjain-stanford/caffe-tensorflow that referenced this pull request Jan 6, 2019
@ilyakava
Copy link

Thanks for this! Fixed the following error for me:

Traceback (most recent call last):
  File "convert.py", line 68, in <module>
    main()
  File "convert.py", line 64, in main
    args.phase)
  File "convert.py", line 27, in convert
    transformer = TensorFlowTransformer(def_path, caffemodel_path, phase=phase)
  File "/root/programs/mycode/caffe-tensorflow/kaffe/tensorflow/transformer.py", line 221, in __init__
    self.load(def_path, data_path, phase)
  File "/root/programs/mycode/caffe-tensorflow/kaffe/tensorflow/transformer.py", line 227, in load
    graph = GraphBuilder(def_path, phase).build()
  File "/root/programs/mycode/caffe-tensorflow/kaffe/graph.py", line 255, in build
    graph.compute_output_shapes()
  File "/root/programs/mycode/caffe-tensorflow/kaffe/graph.py", line 99, in compute_output_shapes
    node.output_shape = TensorShape(*NodeKind.compute_output_shape(node))
  File "/root/programs/mycode/caffe-tensorflow/kaffe/layers.py", line 69, in compute_output_shape
    val = LAYER_DESCRIPTORS[node.kind](node)
  File "/root/programs/mycode/caffe-tensorflow/kaffe/shapes.py", line 78, in shape_pool
    return get_strided_kernel_output_shape(node, math.ceil)
  File "/root/programs/mycode/caffe-tensorflow/kaffe/shapes.py", line 19, in get_strided_kernel_output_shape
    node.layer.kernel_parameters, round_func)
  File "/root/programs/mycode/caffe-tensorflow/kaffe/layers.py", line 137, in kernel_parameters
    k_h = self.get_kernel_value(params.kernel_h, params.kernel_size, 0)
  File "/root/programs/mycode/caffe-tensorflow/kaffe/layers.py", line 130, in get_kernel_value
    raise ValueError('Unable to determine kernel parameter!')
ValueError: Unable to determine kernel parameter!

when params was equal to:

pool: AVE
global_pooling: true

ilyakava added a commit to ilyakava/caffe-tensorflow that referenced this pull request Jan 24, 2020
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.

3 participants