Comments (2)
error info in detail.
Traceback (most recent call last):
File "/home/is-lab/.local/lib/python3.5/site-packages/tensorflow/python/framework/common_shapes.py", line 671, in _call_cpp_shape_fn_impl
input_tensors_as_shapes, status)
File "/usr/lib/python3.5/contextlib.py", line 66, in exit
next(self.gen)
File "/home/is-lab/.local/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Shape must be rank 2 but is rank 3 for 'Masking/MatMul' (op: 'MatMul') with input shapes: [10,16], [1,10,1].
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tf_orginal_CapsNet.py", line 345, in
capsNet = CapsNet(is_training=is_training)
File "tf_orginal_CapsNet.py", line 238, in init
self.build_arch()
File "tf_orginal_CapsNet.py", line 287, in build_arch
self.masked_v = tf.matmul(tf.squeeze(self.caps2), tf.reshape(self.Y, (batch_size, 10, 1)), transpose_a=True)
File "/home/is-lab/.local/lib/python3.5/site-packages/tensorflow/python/ops/math_ops.py", line 1816, in matmul
a, b, transpose_a=transpose_a, transpose_b=transpose_b, name=name)
File "/home/is-lab/.local/lib/python3.5/site-packages/tensorflow/python/ops/gen_math_ops.py", line 1217, in _mat_mul
transpose_b=transpose_b, name=name)
File "/home/is-lab/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 767, in apply_op
op_def=op_def)
File "/home/is-lab/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 2508, in create_op
set_shapes_for_outputs(ret)
File "/home/is-lab/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1873, in set_shapes_for_outputs
shapes = shape_func(op)
File "/home/is-lab/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1823, in call_with_requiring
return call_cpp_shape_fn(op, require_shape_fn=True)
File "/home/is-lab/.local/lib/python3.5/site-packages/tensorflow/python/framework/common_shapes.py", line 610, in call_cpp_shape_fn
debug_python_shape_fn, require_shape_fn)
File "/home/is-lab/.local/lib/python3.5/site-packages/tensorflow/python/framework/common_shapes.py", line 676, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Shape must be rank 2 but is rank 3 for 'Masking/MatMul' (op: 'MatMul') with input shapes: [10,16], [1,10,1].
from capsnet-tensorflow.
This is due to the using of the tf.squeeze
in this line:
self.masked_v = tf.matmul(tf.squeeze(self.caps2), tf.reshape(self.Y, (batch_size, 10, 1)), transpose_a=True)
But, who will set batch size to 1? If you really want it, explicitly squeeze
on caps2 in the last dim, like this:
self.masked_v = tf.multiply(tf.squeeze(self.caps2, axis=-1), tf.reshape(self.Y, (-1, 10, 1)))
from capsnet-tensorflow.
Related Issues (20)
- Only 10% accuracy for scaled images!!!!! HOT 3
- reshape question
- a question HOT 1
- Question about num_outputs
- Train on different dataset HOT 7
- Using Caps-Net to Handle High-dimensional and Small-sample Problems HOT 1
- I have question about loss function. something wrong, i think....? HOT 3
- Baidu Link Not Working Correctly: Mirror?
- Cannot handle rotation ??? HOT 1
- English Version of Blog HOT 1
- Medical Imaging HOT 7
- Vector Length HOT 3
- About the routing biases HOT 2
- TypeError: 'numpy.ndarray' object is not callable!
- a quesion HOT 1
- about tensorflow c++
- about
- about a problem in gpu_version
- How to save model in SavedModel or frozen_graph format?
- Cap
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capsnet-tensorflow.