DetectionTeamUCAS / Cascade-RCNN_Tensorflow

MIT License
90 stars 34 forks source link

Mobilenet_v2 #14

Open huaxv opened 4 years ago

huaxv commented 4 years ago

Hello, we encountered the following problems when we replaced Resnet101 with Mobilenet_v2. How can I solve it?

Traceback (most recent call last): File "train.py", line 185, in train() File "train.py", line 47, in train gtboxes_batch=gtboxes_and_label) File "../libs/networks/build_whole_network.py", line 356, in build_whole_detection_network feature_to_cropped = self.build_base_network(input_img_batch) File "../libs/networks/build_whole_network.py", line 38, in build_base_network return mobilenet_v2.mobilenetv2_base(input_img_batch, is_training=self.is_training) File "../libs/networks/mobilenet_v2.py", line 109, in mobilenetv2_base finegrain_classification_mode=False) File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 182, in func_with_args return func(args, current_args) File "../libs/networks/mobilenet/mobilenet_v2.py", line 162, in mobilenet_base base_only=True, kwargs) File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 182, in func_with_args return func(args, current_args) File "../libs/networks/mobilenet/mobilenet_v2.py", line 154, in mobilenet kwargs) File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 182, in func_with_args return func(args, current_args) File "../libs/networks/mobilenet/mobilenet.py", line 327, in mobilenet net, end_points = mobilenet_base(inputs, scope=scope, mobilenet_args) File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 182, in func_with_args return func(args, **current_args) File "../libs/networks/mobilenet/mobilenet.py", line 200, in mobilenet_base _set_arg_scope_defaults(conv_defs_defaults), \ File "/usr/lib/python3.6/contextlib.py", line 81, in enter return next(self.gen) File "../libs/networks/mobilenet/mobilenet.py", line 91, in _set_arg_scope_defaults func, default_arg = items[0] TypeError: 'dict_items' object does not support indexing

yangxue0827 commented 4 years ago

add code items=list(items) before line91

huaxv commented 4 years ago

A new error occurred just now

Traceback (most recent call last): File "train.py", line 185, in train() File "train.py", line 47, in train gtboxes_batch=gtboxes_and_label) File "../libs/networks/build_whole_network.py", line 470, in build_whole_detection_network scope='stage1') File "../libs/networks/build_whole_network.py", line 199, in build_fastrcnn scope='cls_fc') File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 182, in func_with_args return func(*args, **current_args) File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1840, in fully_connected inputs = ops.convert_to_tensor(inputs) File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1039, in convert_to_tensor return convert_to_tensor_v2(value, dtype, preferred_dtype, name) File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1097, in convert_to_tensor_v2 as_ref=False) File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1175, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 304, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 245, in constant allow_broadcast=True) File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 283, in _constant_impl allow_broadcast=allow_broadcast)) File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/framework/tensor_util.py", line 454, in make_tensor_proto raise ValueError("None values not supported.") ValueError: None values not supported.

chriszhang528 commented 4 years ago

@huaxv,I had the same problem, how can I solve it,please?

lyj157175 commented 4 years ago

@huaxv ,I had the same problem, how can I solve it,please?

lyj157175 commented 4 years ago

@chriszhang528 ,mobilenet_v2.py add code return flatten after line126 ,line 129 slim.flatten(inputs) ,input -> inputs