Open shuangwu opened 7 years ago
this may be related to #63
FYI, this is using protobuf backend, not caffe backend.
I have the same problem How to modify the code to solve it?
Same issues here. Anybody found a solution?
I got it to work by replacing scale_offset= len(node.data) == 4
with scale_offset = len(node.output_shape) == 4
in transformer.py
I don't know if this breaks something else, but it definitely makes the ResNet50 and ResNet101 work.
I solved this problem by installing pycaffe.
To address the first issue, try changing
squeeze_indices = [1] # Squeeze biases.
if node.kind == NodeKind.InnerProduct:
squeeze_indices.append(0) # Squeeze FC.
to
squeeze_indices = []
if node.kind == NodeKind.Convolution or node.kind == NodeKind.InnerProduct:
if node.parameters.bias_term:
squeeze_indices.append(1)
if node.kind == NodeKind.InnerProduct:
squeeze_indices.append(0) # Squeeze FC.
in transformers.py. This fixes the "index out of range" issue for convolutions without a bias term, as well as an issue where BatchNorm variance was getting squeezed incorrectly.
scale_offset = len(node.output_shape) == 4
this
I got it to work by replacing
scale_offset= len(node.data) == 4
withscale_offset = len(node.output_shape) == 4
intransformer.py
I don't know if this breaks something else, but it definitely makes the ResNet50 and ResNet101 work.
thanks, it fix the error.
when converting models downloaded from https://github.com/KaimingHe/deep-residual-networks#models, ended up with error:
If saving only source code, ended up with error:
My fix is around line 155 of transformer.py:
but the first error remains.