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

Error - ValueError: Shape must be rank 4 but is rank 2 for 'Pad_7' (op: 'Pad') with input shapes: [?,1024], [4,2]. #2

Open
mitchross opened this issue Jul 6, 2019 · 0 comments

Comments

@mitchross
Copy link

(python36) unraid@unraid-ubuntu:~/Desktop/projects/AI-ipcam$ python ai-ipcam.py
Watching for: ['person', 'cat', 'dog', 'bird']
Stream: 'rtsp://192.168.X.XXX/ch0_0.h264'
MQTT broker: '192.168.X.XX'
MQTT topic: 'yicam/motion2'
Show image: 'yes'
Parsing ./cfg/darknet.cfg
Parsing cfg/darknet.cfg
Loading cfg/darknet.weights ...
Successfully identified 29293936 bytes
Finished in 0.006495475769042969s

Building net ...
Source | Train? | Layer description | Output size
-------+--------+----------------------------------+---------------
| | input | (?, 256, 256, 3)
Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 256, 256, 16)
Load | Yep! | maxp 2x2p0_2 | (?, 128, 128, 16)
Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 128, 128, 32)
Load | Yep! | maxp 2x2p0_2 | (?, 64, 64, 32)
Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 64, 64, 64)
Load | Yep! | maxp 2x2p0_2 | (?, 32, 32, 64)
Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 32, 32, 128)
Load | Yep! | maxp 2x2p0_2 | (?, 16, 16, 128)
Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 16, 16, 256)
Load | Yep! | maxp 2x2p0_2 | (?, 8, 8, 256)
Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 8, 8, 512)
Load | Yep! | maxp 2x2p0_2 | (?, 4, 4, 512)
Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 4, 4, 1024)
Load | Yep! | avgpool() | (?, 1024)
Traceback (most recent call last):
File "/home/unraid/anaconda3/envs/python36/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: Shape must be rank 4 but is rank 2 for 'Pad_7' (op: 'Pad') with input shapes: [?,1024], [4,2].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "ai-ipcam.py", line 88, in
tfnet = TFNet(options)
File "/home/unraid/anaconda3/envs/python36/lib/python3.6/site-packages/darkflow/net/build.py", line 75, in init
self.build_forward()
File "/home/unraid/anaconda3/envs/python36/lib/python3.6/site-packages/darkflow/net/build.py", line 115, in build_forward
state = op_create(*args)
File "/home/unraid/anaconda3/envs/python36/lib/python3.6/site-packages/darkflow/net/ops/init.py", line 27, in op_create
return op_typeslayer_type
File "/home/unraid/anaconda3/envs/python36/lib/python3.6/site-packages/darkflow/net/ops/baseop.py", line 42, in init
self.forward()
File "/home/unraid/anaconda3/envs/python36/lib/python3.6/site-packages/darkflow/net/ops/convolution.py", line 69, in forward
temp = tf.pad(self.inp.out, [[0, 0]] + pad + [[0, 0]])
File "/home/unraid/anaconda3/envs/python36/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1881, in pad
result = gen_array_ops.pad(tensor, paddings, name=name)
File "/home/unraid/anaconda3/envs/python36/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 4681, in pad
"Pad", input=input, paddings=paddings, name=name)
File "/home/unraid/anaconda3/envs/python36/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/home/unraid/anaconda3/envs/python36/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3414, in create_op
op_def=op_def)
File "/home/unraid/anaconda3/envs/python36/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1756, in init
control_input_ops)
File "/home/unraid/anaconda3/envs/python36/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1592, in _create_c_op
raise ValueError(str(e))
ValueError: Shape must be rank 4 but is rank 2 for 'Pad_7' (op: 'Pad') with input shapes: [?,1024], [4,2].

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

1 participant