hellochick / ICNet-tensorflow

TensorFlow-based implementation of "ICNet for Real-Time Semantic Segmentation on High-Resolution Images".
406 stars 153 forks source link

Dimension not equal #114

Closed ericliyanghui closed 4 years ago

ericliyanghui commented 4 years ago

When I follow the instruction, and start train network using pre-trained model "icnet_cityscapes_train_30k_bnnomerge.npy"(I download it manually following the code because I cannot download it automatically). But I got the following error:

`Error: ./model/cityscapes/icnet_cityscapes_train_30k_bnnomerge.npy Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 1864, in _create_c_op c_op = c_api.TF_FinishOperation(op_desc) tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimension 0 in both shapes must be equal, but are 512 and 256. Shapes are [512] and [256]. for 'conv3_1_1x1_proj_bn_2/Assign' (op: 'Assign') with input shapes: [512], [256].

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "train.py", line 165, in main() File "train.py", line 145, in main train_net.restore(cfg.model_weight, restore_var) File "/home/lxiao/icnet/ICNet-tensorflow/network.py", line 78, in restore self.load_npy(data_path, self.sess) File "/home/lxiao/icnet/ICNet-tensorflow/network.py", line 111, in load_npy session.run(var.assign(data)) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/variables.py", line 1952, in assign name=name) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/state_ops.py", line 227, in assign validate_shape=validate_shape) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/gen_state_ops.py", line 66, in assign use_locking=use_locking, name=name) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper op_def=op_def) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/deprecation.py", line 507, in new_func return func(*args, **kwargs) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 3616, in create_op op_def=op_def) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 2027, in init control_input_ops) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 1867, in _create_c_op raise ValueError(str(e)) ValueError: Dimension 0 in both shapes must be equal, but are 512 and 256. Shapes are [512] and [256]. for 'conv3_1_1x1_proj_bn_2/Assign' (op: 'Assign') with input shapes: [512], [256].`

I used python3, tensorflow 1.14.0

Help Me!

ericliyanghui commented 4 years ago

I have solved it by setting “filter-scale to 1” instead of the guidance the “filter-scale to 2”