DetectionTeamUCAS / DetectionTeamUCAS/NAS_FPN_Tensorflow

ValueError: Dimensions must be equal, but are 256 and 384 for 'tower_0/build_pyramid/build_P4/add' (op: 'Add') with input shapes: [1,?,?,256], [1,?,?,384].

Open
#14 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
217
Forks
62
PR merge metrics
No merged PRs in 30d

Description

I try to training my dataset, and i have reference the three steps in README.md, I use the pretrained weights resnet_v1_50.ckpt, and i modify the $PATH_ROOT/libs/configs/cfgs.py and $PATH_ROOT/libs/label_name_dict/lable_dict.py and $PATH_ROOT/data/io/read_tfrecord.py, the NET_NAME has been alter with "resnet_v1_50", However ,after "python ./tools/multi_gpu_train.py",the error msg:
++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--
./NAS_FPN_Tensorflow-master
WARNING:tensorflow:From multi_gpu_train.py:123: get_or_create_global_step (from tensorflow.contrib.framework.python.ops.variables) is deprecated and will be removed in a future version.
Instructions for updating:
Please switch to tf.train.get_or_create_global_step
tfrecord path is --> ./NAS_FPN_Tensorflow-master/data/tfrecord/occlusion_recognition_train*
Traceback (most recent call last):
File "./envs/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1589, in _create_c_op
c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimensions must be equal, but are 256 and 384 for 'tower_0/build_pyramid/build_P4/add' (op: 'Add') with input shapes: [1,?,?,256], [1,?,?,384].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "multi_gpu_train.py", line 352, in
train()
File "multi_gpu_train.py", line 212, in train
gtboxes_batch=gtboxes_and_label)
File "../libs/networks/build_whole_network.py", line 386, in build_whole_detection_network
P_list = self.build_base_network(input_img_batch)
File "../libs/networks/build_whole_network.py", line 35, in build_base_network
return resnet.resnet_base(input_img_batch, scope_name=self.base_network_name, is_training=self.is_training)
File "../libs/networks/resnet.py", line 189, in resnet_base
scope='build_P%d' % level)
File "../libs/networks/resnet.py", line 63, in fusion_two_layer
add_f = 0.5*upsample_p + 0.5*reduce_dim_c
File "./envs/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py", line 847, in binary_op_wrapper
return func(x, y, name=name)
File "./envs/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/gen_math_ops.py", line 297, in add
"Add", x=x, y=y, name=name)
File "./envs/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "./envs/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3414, in create_op
op_def=op_def)
File "./anaconda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1756, in __init__
control_input_ops)
File "./envs/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1592, in _create_c_op
raise ValueError(str(e))
ValueError: Dimensions must be equal, but are 256 and 384 for 'tower_0/build_pyramid/build_P4/add' (op: 'Add') with input shapes: [1,?,?,256], [1,?,?,384].

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with libs/networks/resnet.py, especially fusion_two_layer at line 63, and trace its callers in libs/networks/build_whole_network.py; compare the NET_NAME and pretrained-weight setup in libs/configs/cfgs.py with the tensors reaching build_P4. Re-run python ./tools/multi_gpu_train.py after checking the documented configuration, and consider it done when graph construction no longer raises the reported channel mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.