Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it shows me that Dimensions is not equal #89

Open
quhb2455 opened this issue Jun 4, 2020 · 2 comments
Open

it shows me that Dimensions is not equal #89

quhb2455 opened this issue Jun 4, 2020 · 2 comments

Comments

@quhb2455
Copy link

quhb2455 commented Jun 4, 2020

(lim) C:\Users\Rentalhub\Desktop\CSP-master\CSP-master>python train_city.py
Using TensorFlow backend.
2020-06-04 16:24:48.520936: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
num of training samples: 2975

2020-06-04 16:24:50.878578: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2020-06-04 16:24:51.169308: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:
name: GeForce GTX 1050 major: 6 minor: 1 memoryClockRate(GHz): 1.493
pciBusID: 0000:01:00.0
2020-06-04 16:24:51.177449: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2020-06-04 16:24:51.189843: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2020-06-04 16:24:51.193950: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
2020-06-04 16:24:51.204817: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:
name: GeForce GTX 1050 major: 6 minor: 1 memoryClockRate(GHz): 1.493
pciBusID: 0000:01:00.0
2020-06-04 16:24:51.212932: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2020-06-04 16:24:51.225292: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2020-06-04 16:24:51.848683: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-06-04 16:24:51.853215: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165] 0
2020-06-04 16:24:51.855928: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0: N
2020-06-04 16:24:51.868025: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3002 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050, pci bus id: 0000:01:00.0, compute capability: 6.1)

tracking <tf.Variable 'P3norm/P3norm_gamma:0' shape=(160,) dtype=float32> gamma
Traceback (most recent call last):
File "C:\Users\Rentalhub\anaconda3\envs\lim\lib\site-packages\tensorflow_core\python\framework\ops.py", line 1610, 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 160 for 'P3norm/mul' (op: 'Mul') with input shapes: [?,?,?,256], [160].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train_city.py", line 45, in
preds = nn.nn_p3p4p5(img_input, offset=C.offset, num_scale=C.num_scale, trainable=True)
File "C:\Users\Rentalhub\Desktop\CSP-master\CSP-master\keras_csp\resnet50.py", line 316, in nn_p3p4p5
P3_up = L2Normalization(gamma_init=10, name='P3norm')(P3_up)
File "C:\Users\Rentalhub\anaconda3\envs\lim\lib\site-packages\keras\backend\tensorflow_backend.py", line 75, in symbolic_fn_wrapper
return func(*args, **kwargs)
File "C:\Users\Rentalhub\anaconda3\envs\lim\lib\site-packages\keras\engine\base_layer.py", line 489, in call
output = self.call(inputs, **kwargs)
File "C:\Users\Rentalhub\Desktop\CSP-master\CSP-master\keras_csp\keras_layer_L2Normalization.py", line 63, in call
output *= self.gamma
File "C:\Users\Rentalhub\anaconda3\envs\lim\lib\site-packages\tensorflow_core\python\ops\math_ops.py", line 912, in binary_op_wrapper
return func(x, y, name=name)
File "C:\Users\Rentalhub\anaconda3\envs\lim\lib\site-packages\tensorflow_core\python\ops\math_ops.py", line 1206, in _mul_dispatch
return gen_math_ops.mul(x, y, name=name)
File "C:\Users\Rentalhub\anaconda3\envs\lim\lib\site-packages\tensorflow_core\python\ops\gen_math_ops.py", line 6701, in mul
"Mul", x=x, y=y, name=name)
File "C:\Users\Rentalhub\anaconda3\envs\lim\lib\site-packages\tensorflow_core\python\framework\op_def_library.py", line 793, in _apply_op_helper
op_def=op_def)
File "C:\Users\Rentalhub\anaconda3\envs\lim\lib\site-packages\tensorflow_core\python\framework\func_graph.py", line 548, in create_op
compute_device)
File "C:\Users\Rentalhub\anaconda3\envs\lim\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3429, in _create_op_internal
op_def=op_def)
File "C:\Users\Rentalhub\anaconda3\envs\lim\lib\site-packages\tensorflow_core\python\framework\ops.py", line 1773, in init
control_input_ops)
File "C:\Users\Rentalhub\anaconda3\envs\lim\lib\site-packages\tensorflow_core\python\framework\ops.py", line 1613, in _create_c_op
raise ValueError(str(e))
ValueError: Dimensions must be equal, but are 256 and 160 for 'P3norm/mul' (op: 'Mul') with input shapes: [?,?,?,256], [160].

i got this ValueError.
before this errro came up, there were some miss match function between my python version and this python. so i tried to change old function to new one.
i think this error is in L2Normalization function.
somebody help me..

i use
pyhton 3.7
CUDA 10.0
tensorflow 2.0
tensorflow-gpu 2.0

@Nelsonly
Copy link

did you get it?

@quhb2455
Copy link
Author

@Nelsonly sorry not yet..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants