Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------------------
- InvalidArgumentError Traceback (most recent call last)
- /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/common_shapes.py in _call_cpp_shape_fn_impl(op, input_tensors_needed, input_tensors_as_shapes_needed, debug_python_shape_fn, require_shape_fn)
- 670 graph_def_version, node_def_str, input_shapes, input_tensors,
- --> 671 input_tensors_as_shapes, status)
- 672 except errors.InvalidArgumentError as err:
- /usr/lib/python3.5/contextlib.py in __exit__(self, type, value, traceback)
- 65 try:
- ---> 66 next(self.gen)
- 67 except StopIteration:
- /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py in raise_exception_on_not_ok_status()
- 465 compat.as_text(pywrap_tensorflow.TF_Message(status)),
- --> 466 pywrap_tensorflow.TF_GetCode(status))
- 467 finally:
- InvalidArgumentError: Shapes must be equal rank, but are 1 and 0 for 'batch_normalization_3/Assign' (op: 'Assign') with input shapes: [16], [].
- During handling of the above exception, another exception occurred:
- ValueError Traceback (most recent call last)
- <ipython-input-8-51a83b4ec6c0> in <module>()
- 17 elif type(old_layer) == BatchNormalization:
- 18 bn_layer = BatchNormalization(weights=weights)
- ---> 19 prev_layer = bn_layer(prev_layer)
- /usr/local/lib/python3.5/dist-packages/keras/engine/topology.py in __call__(self, inputs, **kwargs)
- 574 # Load weights that were specified at layer instantiation.
- 575 if self._initial_weights is not None:
- --> 576 self.set_weights(self._initial_weights)
- 577
- 578 # Raise exceptions in case the input is not compatible
- /usr/local/lib/python3.5/dist-packages/keras/engine/topology.py in set_weights(self, weights)
- 1190 'provided weight shape ' + str(w.shape))
- 1191 weight_value_tuples.append((p, w))
- -> 1192 K.batch_set_value(weight_value_tuples)
- 1193
- 1194 def get_weights(self):
- /usr/local/lib/python3.5/dist-packages/keras/backend/tensorflow_backend.py in batch_set_value(tuples)
- 2182 assign_placeholder = tf.placeholder(tf_dtype,
- 2183 shape=value.shape)
- -> 2184 assign_op = x.assign(assign_placeholder)
- 2185 x._assign_placeholder = assign_placeholder
- 2186 x._assign_op = assign_op
- /usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/variables.py in assign(self, value, use_locking)
- 510 the assignment has completed.
- 511 """
- --> 512 return state_ops.assign(self._variable, value, use_locking=use_locking)
- 513
- 514 def assign_add(self, delta, use_locking=False):
- /usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/state_ops.py in assign(ref, value, validate_shape, use_locking, name)
- 268 return gen_state_ops.assign(
- 269 ref, value, use_locking=use_locking, name=name,
- --> 270 validate_shape=validate_shape)
- 271 return ref.assign(value, name=name)
- /usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/gen_state_ops.py in assign(ref, value, validate_shape, use_locking, name)
- 45 result = _op_def_lib.apply_op("Assign", ref=ref, value=value,
- 46 validate_shape=validate_shape,
- ---> 47 use_locking=use_locking, name=name)
- 48 return result
- 49
- /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/op_def_library.py in apply_op(self, op_type_name, name, **keywords)
- 766 op = g.create_op(op_type_name, inputs, output_types, name=scope,
- 767 input_types=input_types, attrs=attr_protos,
- --> 768 op_def=op_def)
- 769 if output_structure:
- 770 outputs = op.outputs
- /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py in create_op(self, op_type, inputs, dtypes, input_types, name, attrs, op_def, compute_shapes, compute_device)
- 2336 original_op=self._default_original_op, op_def=op_def)
- 2337 if compute_shapes:
- -> 2338 set_shapes_for_outputs(ret)
- 2339 self._add_op(ret)
- 2340 self._record_op_seen_by_control_dependencies(ret)
- /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py in set_shapes_for_outputs(op)
- 1717 shape_func = _call_cpp_shape_fn_and_require_op
- 1718
- -> 1719 shapes = shape_func(op)
- 1720 if shapes is None:
- 1721 raise RuntimeError(
- /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py in call_with_requiring(op)
- 1667
- 1668 def call_with_requiring(op):
- -> 1669 return call_cpp_shape_fn(op, require_shape_fn=True)
- 1670
- 1671 _call_cpp_shape_fn_and_require_op = call_with_requiring
- /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/common_shapes.py in call_cpp_shape_fn(op, input_tensors_needed, input_tensors_as_shapes_needed, debug_python_shape_fn, require_shape_fn)
- 608 res = _call_cpp_shape_fn_impl(op, input_tensors_needed,
- 609 input_tensors_as_shapes_needed,
- --> 610 debug_python_shape_fn, require_shape_fn)
- 611 if not isinstance(res, dict):
- 612 # Handles the case where _call_cpp_shape_fn_impl calls unknown_shape(op).
- /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/common_shapes.py in _call_cpp_shape_fn_impl(op, input_tensors_needed, input_tensors_as_shapes_needed, debug_python_shape_fn, require_shape_fn)
- 674 missing_shape_fn = True
- 675 else:
- --> 676 raise ValueError(err.message)
- 677
- 678 if missing_shape_fn:
- ValueError: Shapes must be equal rank, but are 1 and 0 for 'batch_normalization_3/Assign' (op: 'Assign') with input shapes: [16], [].
Add Comment
Please, Sign In to add comment