iamhankai / attribute-aware-attention

[ACM MM 2018] Attribute-Aware Attention Model for Fine-grained Representation Learning
https://arxiv.org/abs/1901.00392
156 stars 30 forks source link

two questions #6

Closed GYxiaOH closed 5 years ago

GYxiaOH commented 5 years ago

Thank you for your beautiful paper and code, but i have two question when i did your experiment

1.it's my first time run keras' code, when i run run.sh "ValueError: Negative dimension size caused by subtracting 3 from 2 for 'MaxPool' (op: 'MaxPool') with input shapes: [?,2,2240,64]." I don't know why. my log is as below: model_raw = eval(net)(input_tensor=inputs, include_top=False, weights='imagenet') File "/usr/local/lib/python2.7/dist-packages/keras/applications/resnet50.py", line 179, in ResNet50 x = MaxPooling2D((3, 3), strides=(2, 2))(x) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 572, in call self.add_inbound_node(inbound_layers, node_indices, tensor_indices) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 635, in add_inbound_node Node.create_node(self, inbound_layers, node_indices, tensor_indices) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 166, in create_node output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0])) File "/usr/local/lib/python2.7/dist-packages/keras/layers/pooling.py", line 160, in call dim_ordering=self.dim_ordering) File "/usr/local/lib/python2.7/dist-packages/keras/layers/pooling.py", line 210, in _pooling_function pool_mode='max') File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 2786, in pool2d x = tf.nn.max_pool(x, pool_size, strides, padding=padding) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_ops.py", line 1958, in max_pool name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_nn_ops.py", line 2806, in _max_pool data_format=data_format, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2958, in create_op set_shapes_for_outputs(ret) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2209, in set_shapes_for_outputs shapes = shape_func(op) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2159, in call_with_requiring return call_cpp_shape_fn(op, require_shape_fn=True) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/common_shapes.py", line 627, in call_cpp_shape_fn require_shape_fn) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/common_shapes.py", line 691, in _call_cpp_shape_fn_impl raise ValueError(err.message) ValueError: Negative dimension size caused by subtracting 3 from 2 for 'MaxPool' (op: 'MaxPool') with input shapes: [?,2,2240,64].

2.what's mean about parameter "nb_attributes",I want do experiment in subset of CUB, should i change it?

iamhankai commented 5 years ago
  1. Maybe you should change "image_data_format" in $HOME/.keras/keras.json

  2. "nb_attributes" means the number of attributes you used. For details to generate attribute labels, refer to https://github.com/iamhankai/attribute-aware-attention/tree/master/tools

GYxiaOH commented 5 years ago

@iamhankai Thank you for your reply. Maybe I know the reason .It's about version of keras and tensorflow ,maybe you need write your environment .In my computer, tensorflow is 1.4 and keras is 2.1.2 I know the mean about "nb_attributes" , thank for your help