---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-13-bb9905116611> in <module>()
3 theta = tf.Variable(tf.zeros([2, 1]))
4 h = tf.matmul(x, theta)
----> 5 J = tf.reduce_sum(tf.pow(h - y,2)) / 2 * tf.size(x)[0] + tf.reduce_sum(tf.pow(theta,2))
/home/jakob/miniconda2/envs/ml-software/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py in _SliceHelper(tensor, slice_spec)
199 sizes.append(1)
200 squeeze_dims.append(dim)
--> 201 sliced = slice(tensor, indices, sizes)
202 if squeeze_dims:
203 return squeeze(sliced, squeeze_dims=squeeze_dims)
/home/jakob/miniconda2/envs/ml-software/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py in slice(input_, begin, size, name)
249 A `Tensor` the same type as `input`.
250 """
--> 251 return gen_array_ops._slice(input_, begin, size, name=name)
252
253
/home/jakob/miniconda2/envs/ml-software/lib/python3.5/site-packages/tensorflow/python/ops/gen_array_ops.py in _slice(input, begin, size, name)
1632 """
1633 result = _op_def_lib.apply_op("Slice", input=input, begin=begin, size=size,
-> 1634 name=name)
1635 return result
1636
/home/jakob/miniconda2/envs/ml-software/lib/python3.5/site-packages/tensorflow/python/ops/op_def_library.py in apply_op(self, op_type_name, name, **keywords)
702 op = g.create_op(op_type_name, inputs, output_types, name=scope,
703 input_types=input_types, attrs=attr_protos,
--> 704 op_def=op_def)
705 outputs = op.outputs
706 return _Restructure(ops.convert_n_to_tensor(outputs),
/home/jakob/miniconda2/envs/ml-software/lib/python3.5/site-packages/tensorflow/python/framework/ops.py in create_op(self, op_type, inputs, dtypes, input_types, name, attrs, op_def, compute_shapes, compute_device)
2260 original_op=self._default_original_op, op_def=op_def)
2261 if compute_shapes:
-> 2262 set_shapes_for_outputs(ret)
2263 self._add_op(ret)
2264 self._record_op_seen_by_control_dependencies(ret)
/home/jakob/miniconda2/envs/ml-software/lib/python3.5/site-packages/tensorflow/python/framework/ops.py in set_shapes_for_outputs(op)
1700 raise RuntimeError("No shape function registered for standard op: %s"
1701 % op.type)
-> 1702 shapes = shape_func(op)
1703 if shapes is None:
1704 raise RuntimeError(
/home/jakob/miniconda2/envs/ml-software/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py in _SliceShape(op)
1052 ndims = begin_shape.merge_with(sizes_shape)[0].value
1053 if ndims is not None:
-> 1054 input_shape.assert_has_rank(ndims)
1055 begin_value = tensor_util.constant_value(op.inputs[1])
1056 sizes_value = tensor_util.constant_value(op.inputs[2])
/home/jakob/miniconda2/envs/ml-software/lib/python3.5/site-packages/tensorflow/python/framework/tensor_shape.py in assert_has_rank(self, rank)
619 """
620 if self.ndims not in (None, rank):
--> 621 raise ValueError("Shape %s must have rank %d" % (self, rank))
622
623 def with_rank(self, rank):
ValueError: Shape () must have rank 1