Skip to content

Instantly share code, notes, and snippets.

@milani
Created January 27, 2018 10:35
Show Gist options
  • Save milani/591a0070409efd5ecbd63afff4f1886a to your computer and use it in GitHub Desktop.
Save milani/591a0070409efd5ecbd63afff4f1886a to your computer and use it in GitHub Desktop.
============================= test session starts ==============================
platform linux -- Python 3.5.3, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
rootdir: /fast/keras-rcnn, inifile: setup.cfg
collected 9 items
tests/layers/object_detection/test_anchor_target.py FFFFFFFFF [100%]
=================================== FAILURES ===================================
__________________________________ test_label __________________________________
def test_label():
stride = 16
feat_h, feat_w = (14, 14)
img_info = keras.backend.variable([[224, 224, 3]])
gt_boxes = keras.backend.variable(100 * numpy.random.random((91, 4)))
> gt_boxes = tensorflow.convert_to_tensor(gt_boxes, dtype=tensorflow.float32)
tests/layers/object_detection/test_anchor_target.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py:836: in convert_to_tensor
as_ref=False)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py:926: in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
v = <tf.Variable 'Variable_1:0' shape=(91, 4) dtype=float64_ref>
dtype = tf.float32, name = None, as_ref = False
@staticmethod
def _TensorConversionFunction(v, dtype=None, name=None, as_ref=False): # pylint: disable=invalid-name
"""Utility function for converting a Variable to a Tensor."""
_ = name
if dtype and not dtype.is_compatible_with(v.dtype):
raise ValueError(
"Incompatible type conversion requested to type '%s' for variable "
> "of type '%s'" % (dtype.name, v.dtype.name))
E ValueError: Incompatible type conversion requested to type 'float32' for variable of type 'float64_ref'
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/ops/variables.py:726: ValueError
________________________ test_subsample_positive_labels ________________________
def test_subsample_positive_labels():
x = keras.backend.ones((10,))
y = anchor_target.subsample_positive_labels(
> x)
tests/layers/object_detection/test_anchor_target.py:73:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
keras_rcnn/layers/object_detection/_anchor_target.py:297: in subsample_positive_labels
return keras.backend.switch(condition, labels, lambda: more_positive())
/home/morteza/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:2811: in switch
else_expression_fn)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/util/deprecation.py:316: in new_func
return func(*args, **kwargs)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/ops/control_flow_ops.py:1864: in cond
orig_res_f, res_f = context_f.BuildCondBranch(false_fn)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/ops/control_flow_ops.py:1725: in BuildCondBranch
original_result = fn()
keras_rcnn/layers/object_detection/_anchor_target.py:297: in <lambda>
return keras.backend.switch(condition, labels, lambda: more_positive())
keras_rcnn/layers/object_detection/_anchor_target.py:291: in more_positive
updates = inverse_labels + updates
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/ops/math_ops.py:885: in binary_op_wrapper
y = ops.convert_to_tensor(y, dtype=x.dtype.base_dtype, name="y")
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py:836: in convert_to_tensor
as_ref=False)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py:926: in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
t = <tf.Tensor 'cond/mul:0' shape=(?,) dtype=float32>, dtype = tf.float64
name = 'y', as_ref = False
def _TensorTensorConversionFunction(t, dtype=None, name=None, as_ref=False):
_ = name, as_ref
if dtype and not dtype.is_compatible_with(t.dtype):
raise ValueError(
"Tensor conversion requested dtype %s for Tensor with dtype %s: %r" %
> (dtype.name, t.dtype.name, str(t)))
E ValueError: Tensor conversion requested dtype float64 for Tensor with dtype float32: 'Tensor("cond/mul:0", shape=(?,), dtype=float32)'
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py:774: ValueError
________________________ test_subsample_negative_labels ________________________
def test_subsample_negative_labels():
> x = keras.backend.zeros((10,))
tests/layers/object_detection/test_anchor_target.py:89:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/morteza/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:691: in zeros
return variable(v, dtype=dtype, name=name)
/home/morteza/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:392: in variable
v = tf.Variable(value, dtype=tf.as_dtype(dtype), name=name)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/ops/variables.py:213: in __init__
constraint=constraint)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'Variable' object has no attribute '_variable'") raised in repr()] Variable object at 0x7f0148941668>
initial_value = <tf.Tensor 'zeros:0' shape=(10,) dtype=float64>
trainable = True, collections = ['variables', 'trainable_variables']
validate_shape = True, caching_device = None, name = 'Variable_3/'
dtype = tf.float64, expected_shape = None, constraint = None
def _init_from_args(self,
initial_value=None,
trainable=True,
collections=None,
validate_shape=True,
caching_device=None,
name=None,
dtype=None,
expected_shape=None,
constraint=None):
"""Creates a new variable from arguments.
Args:
initial_value: A `Tensor`, or Python object convertible to a `Tensor`,
which is the initial value for the Variable. The initial value must have
a shape specified unless `validate_shape` is set to False. Can also be a
callable with no argument that returns the initial value when called.
(Note that initializer functions from init_ops.py must first be bound
to a shape before being used here.)
trainable: If `True`, the default, also adds the variable to the graph
collection `GraphKeys.TRAINABLE_VARIABLES`. This collection is used as
the default list of variables to use by the `Optimizer` classes.
collections: List of graph collections keys. The new variable is added to
these collections. Defaults to `[GraphKeys.GLOBAL_VARIABLES]`.
validate_shape: If `False`, allows the variable to be initialized with a
value of unknown shape. If `True`, the default, the shape of
`initial_value` must be known.
caching_device: Optional device string or function describing where the
Variable should be cached for reading. Defaults to the Variable's
device. If not `None`, caches on another device. Typical use is to
cache on the device where the Ops using the Variable reside, to
deduplicate copying through `Switch` and other conditional statements.
name: Optional name for the variable. Defaults to `'Variable'` and gets
uniquified automatically.
dtype: If set, initial_value will be converted to the given type.
If None, either the datatype will be kept (if initial_value is
a Tensor) or float32 will be used (if it is a Python object convertible
to a Tensor).
expected_shape: Deprecated. Ignored.
constraint: An optional projection function to be applied to the variable
after being updated by an `Optimizer` (e.g. used to implement norm
constraints or value constraints for layer weights). The function must
take as input the unprojected Tensor representing the value of the
variable and return the Tensor for the projected value
(which must have the same shape). Constraints are not safe to
use when doing asynchronous distributed training.
Raises:
ValueError: If the initial value is not specified, or does not have a
shape and `validate_shape` is `True`.
"""
_ = expected_shape
if initial_value is None:
raise ValueError("initial_value must be specified.")
init_from_fn = callable(initial_value)
if collections is None:
collections = [ops.GraphKeys.GLOBAL_VARIABLES]
if not isinstance(collections, (list, tuple, set)):
raise ValueError(
"collections argument to Variable constructor must be a list, tuple, "
"or set. Got %s of type %s" % (collections, type(collections)))
if constraint is not None and not callable(constraint):
raise ValueError("The `constraint` argument must be a callable.")
if trainable and ops.GraphKeys.TRAINABLE_VARIABLES not in collections:
collections = list(collections) + [ops.GraphKeys.TRAINABLE_VARIABLES]
with ops.control_dependencies(None):
with ops.name_scope(name, "Variable", [] if init_from_fn else
[initial_value]) as name:
if init_from_fn:
# Use attr_scope and device(None) to simulate the behavior of
# colocate_with when the variable we want to colocate with doesn't
# yet exist.
true_name = ops._name_from_scope_name(name) # pylint: disable=protected-access
attr = attr_value_pb2.AttrValue(
list=attr_value_pb2.AttrValue.ListValue(
s=[compat.as_bytes("loc:@%s" % true_name)]))
# pylint: disable=protected-access
with ops.get_default_graph()._attr_scope({"_class": attr}):
with ops.name_scope("Initializer"), ops.device(None):
self._initial_value = ops.convert_to_tensor(
initial_value(), name="initial_value", dtype=dtype)
shape = (self._initial_value.get_shape()
if validate_shape else tensor_shape.unknown_shape())
self._variable = state_ops.variable_op_v2(
shape,
self._initial_value.dtype.base_dtype,
name=name)
# pylint: enable=protected-access
# Or get the initial value from a Tensor or Python object.
else:
self._initial_value = ops.convert_to_tensor(
initial_value, name="initial_value", dtype=dtype)
# pylint: disable=protected-access
if self._initial_value.op._get_control_flow_context() is not None:
raise ValueError(
"Initializer for variable %s is from inside a control-flow "
"construct, such as a loop or conditional. When creating a "
"variable inside a loop or conditional, use a lambda as the "
> "initializer." % name)
E ValueError: Initializer for variable Variable_3/ is from inside a control-flow construct, such as a loop or conditional. When creating a variable inside a loop or conditional, use a lambda as the initializer.
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/ops/variables.py:322: ValueError
_________________________________ test_balance _________________________________
def test_balance():
> x = keras.backend.zeros((91,))
tests/layers/object_detection/test_anchor_target.py:108:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/morteza/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:691: in zeros
return variable(v, dtype=dtype, name=name)
/home/morteza/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:392: in variable
v = tf.Variable(value, dtype=tf.as_dtype(dtype), name=name)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/ops/variables.py:213: in __init__
constraint=constraint)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'Variable' object has no attribute '_variable'") raised in repr()] Variable object at 0x7f0148faed68>
initial_value = <tf.Tensor 'zeros_1:0' shape=(91,) dtype=float64>
trainable = True, collections = ['variables', 'trainable_variables']
validate_shape = True, caching_device = None, name = 'Variable_4/'
dtype = tf.float64, expected_shape = None, constraint = None
def _init_from_args(self,
initial_value=None,
trainable=True,
collections=None,
validate_shape=True,
caching_device=None,
name=None,
dtype=None,
expected_shape=None,
constraint=None):
"""Creates a new variable from arguments.
Args:
initial_value: A `Tensor`, or Python object convertible to a `Tensor`,
which is the initial value for the Variable. The initial value must have
a shape specified unless `validate_shape` is set to False. Can also be a
callable with no argument that returns the initial value when called.
(Note that initializer functions from init_ops.py must first be bound
to a shape before being used here.)
trainable: If `True`, the default, also adds the variable to the graph
collection `GraphKeys.TRAINABLE_VARIABLES`. This collection is used as
the default list of variables to use by the `Optimizer` classes.
collections: List of graph collections keys. The new variable is added to
these collections. Defaults to `[GraphKeys.GLOBAL_VARIABLES]`.
validate_shape: If `False`, allows the variable to be initialized with a
value of unknown shape. If `True`, the default, the shape of
`initial_value` must be known.
caching_device: Optional device string or function describing where the
Variable should be cached for reading. Defaults to the Variable's
device. If not `None`, caches on another device. Typical use is to
cache on the device where the Ops using the Variable reside, to
deduplicate copying through `Switch` and other conditional statements.
name: Optional name for the variable. Defaults to `'Variable'` and gets
uniquified automatically.
dtype: If set, initial_value will be converted to the given type.
If None, either the datatype will be kept (if initial_value is
a Tensor) or float32 will be used (if it is a Python object convertible
to a Tensor).
expected_shape: Deprecated. Ignored.
constraint: An optional projection function to be applied to the variable
after being updated by an `Optimizer` (e.g. used to implement norm
constraints or value constraints for layer weights). The function must
take as input the unprojected Tensor representing the value of the
variable and return the Tensor for the projected value
(which must have the same shape). Constraints are not safe to
use when doing asynchronous distributed training.
Raises:
ValueError: If the initial value is not specified, or does not have a
shape and `validate_shape` is `True`.
"""
_ = expected_shape
if initial_value is None:
raise ValueError("initial_value must be specified.")
init_from_fn = callable(initial_value)
if collections is None:
collections = [ops.GraphKeys.GLOBAL_VARIABLES]
if not isinstance(collections, (list, tuple, set)):
raise ValueError(
"collections argument to Variable constructor must be a list, tuple, "
"or set. Got %s of type %s" % (collections, type(collections)))
if constraint is not None and not callable(constraint):
raise ValueError("The `constraint` argument must be a callable.")
if trainable and ops.GraphKeys.TRAINABLE_VARIABLES not in collections:
collections = list(collections) + [ops.GraphKeys.TRAINABLE_VARIABLES]
with ops.control_dependencies(None):
with ops.name_scope(name, "Variable", [] if init_from_fn else
[initial_value]) as name:
if init_from_fn:
# Use attr_scope and device(None) to simulate the behavior of
# colocate_with when the variable we want to colocate with doesn't
# yet exist.
true_name = ops._name_from_scope_name(name) # pylint: disable=protected-access
attr = attr_value_pb2.AttrValue(
list=attr_value_pb2.AttrValue.ListValue(
s=[compat.as_bytes("loc:@%s" % true_name)]))
# pylint: disable=protected-access
with ops.get_default_graph()._attr_scope({"_class": attr}):
with ops.name_scope("Initializer"), ops.device(None):
self._initial_value = ops.convert_to_tensor(
initial_value(), name="initial_value", dtype=dtype)
shape = (self._initial_value.get_shape()
if validate_shape else tensor_shape.unknown_shape())
self._variable = state_ops.variable_op_v2(
shape,
self._initial_value.dtype.base_dtype,
name=name)
# pylint: enable=protected-access
# Or get the initial value from a Tensor or Python object.
else:
self._initial_value = ops.convert_to_tensor(
initial_value, name="initial_value", dtype=dtype)
# pylint: disable=protected-access
if self._initial_value.op._get_control_flow_context() is not None:
raise ValueError(
"Initializer for variable %s is from inside a control-flow "
"construct, such as a loop or conditional. When creating a "
"variable inside a loop or conditional, use a lambda as the "
> "initializer." % name)
E ValueError: Initializer for variable Variable_4/ is from inside a control-flow construct, such as a loop or conditional. When creating a variable inside a loop or conditional, use a lambda as the initializer.
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/ops/variables.py:322: ValueError
_______________________________ test_overlapping _______________________________
def test_overlapping():
stride = 16
features = (14, 14)
img_info = keras.backend.variable([[224, 224, 3]])
gt_boxes = numpy.zeros((91, 4))
gt_boxes = keras.backend.variable(gt_boxes)
img_info = img_info[0]
all_anchors = keras_rcnn.backend.shift(features, stride)
inds_inside, all_inside_anchors = anchor_target.inside_image(
all_anchors, img_info)
a, max_overlaps, gt_argmax_overlaps_inds = anchor_target.overlapping(
all_inside_anchors, gt_boxes, inds_inside)
> a = keras.backend.eval(a)
tests/layers/object_detection/test_anchor_target.py:149:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/morteza/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:660: in eval
return to_dense(x).eval(session=get_session())
/home/morteza/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:189: in get_session
[tf.is_variable_initialized(v) for v in candidate_vars])
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:889: in run
run_metadata_ptr)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:1105: in _run
self._graph, fetches, feed_dict_tensor, feed_handles=feed_handles)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:427: in __init__
self._assert_fetchable(graph, fetch.op)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow.python.client.session._FetchHandler object at 0x7f0148c09f28>
graph = <tensorflow.python.framework.ops.Graph object at 0x7f0148fbd9b0>
op = <tf.Operation 'IsVariableInitialized' type=IsVariableInitialized>
def _assert_fetchable(self, graph, op):
if not graph.is_fetchable(op):
raise ValueError(
> 'Operation %r has been marked as not fetchable.' % op.name)
E ValueError: Operation 'IsVariableInitialized' has been marked as not fetchable.
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:440: ValueError
----------------------------- Captured stderr call -----------------------------
2018-01-27 14:28:19.059249: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2018-01-27 14:28:19.236875: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Found device 0 with properties:
name: GeForce GTX 1070 major: 6 minor: 1 memoryClockRate(GHz): 1.7715
pciBusID: 0000:02:00.0
totalMemory: 7.92GiB freeMemory: 4.21GiB
2018-01-27 14:28:19.236909: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 1070, pci bus id: 0000:02:00.0, compute capability: 6.1)
__________________________________ test_unmap __________________________________
def test_unmap():
stride = 16
features = (14, 14)
anchors = 9
total_anchors = features[0] * features[1] * anchors
img_info = keras.backend.variable([[224, 224, 3]])
gt_boxes = numpy.zeros((91, 4))
gt_boxes = keras.backend.variable(gt_boxes)
all_anchors = keras_rcnn.backend.shift(features, stride)
inds_inside, all_inside_anchors = anchor_target.inside_image(
all_anchors, img_info[0])
argmax_overlaps_indices, labels = anchor_target.label(
> gt_boxes, all_inside_anchors, inds_inside)
tests/layers/object_detection/test_anchor_target.py:175:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
keras_rcnn/layers/object_detection/_anchor_target.py:196: in label
return argmax_overlaps_inds, balance(labels)
keras_rcnn/layers/object_detection/_anchor_target.py:136: in balance
labels = subsample_positive_labels(labels)
keras_rcnn/layers/object_detection/_anchor_target.py:297: in subsample_positive_labels
return keras.backend.switch(condition, labels, lambda: more_positive())
/home/morteza/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:2811: in switch
else_expression_fn)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/util/deprecation.py:316: in new_func
return func(*args, **kwargs)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/ops/control_flow_ops.py:1864: in cond
orig_res_f, res_f = context_f.BuildCondBranch(false_fn)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/ops/control_flow_ops.py:1725: in BuildCondBranch
original_result = fn()
keras_rcnn/layers/object_detection/_anchor_target.py:297: in <lambda>
return keras.backend.switch(condition, labels, lambda: more_positive())
keras_rcnn/layers/object_detection/_anchor_target.py:291: in more_positive
updates = inverse_labels + updates
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/ops/math_ops.py:885: in binary_op_wrapper
y = ops.convert_to_tensor(y, dtype=x.dtype.base_dtype, name="y")
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py:836: in convert_to_tensor
as_ref=False)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py:926: in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
t = <tf.Tensor 'cond_1/mul:0' shape=(?,) dtype=float32>, dtype = tf.float64
name = 'y', as_ref = False
def _TensorTensorConversionFunction(t, dtype=None, name=None, as_ref=False):
_ = name, as_ref
if dtype and not dtype.is_compatible_with(t.dtype):
raise ValueError(
"Tensor conversion requested dtype %s for Tensor with dtype %s: %r" %
> (dtype.name, t.dtype.name, str(t)))
E ValueError: Tensor conversion requested dtype float64 for Tensor with dtype float32: 'Tensor("cond_1/mul:0", shape=(?,), dtype=float32)'
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py:774: ValueError
______________________________ test_inside_image _______________________________
def test_inside_image():
stride = 16
features = (14, 14)
all_anchors = keras_rcnn.backend.shift(features, stride)
img_info = (224, 224, 1)
inds_inside, all_inside_anchors = anchor_target.inside_image(
all_anchors, img_info)
> inds_inside = keras.backend.eval(inds_inside)
tests/layers/object_detection/test_anchor_target.py:203:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/morteza/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:660: in eval
return to_dense(x).eval(session=get_session())
/home/morteza/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:189: in get_session
[tf.is_variable_initialized(v) for v in candidate_vars])
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:889: in run
run_metadata_ptr)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:1105: in _run
self._graph, fetches, feed_dict_tensor, feed_handles=feed_handles)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:427: in __init__
self._assert_fetchable(graph, fetch.op)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow.python.client.session._FetchHandler object at 0x7f01440f8f98>
graph = <tensorflow.python.framework.ops.Graph object at 0x7f0148fbd9b0>
op = <tf.Operation 'IsVariableInitialized_5' type=IsVariableInitialized>
def _assert_fetchable(self, graph, op):
if not graph.is_fetchable(op):
raise ValueError(
> 'Operation %r has been marked as not fetchable.' % op.name)
E ValueError: Operation 'IsVariableInitialized_5' has been marked as not fetchable.
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:440: ValueError
______________________ test_inside_and_outside_weights_1 _______________________
def test_inside_and_outside_weights_1():
anchors = numpy.array(
[[30, 20, 50, 30],
[10, 15, 20, 25],
[ 5, 15, 20, 22]]
)
anchors = keras.backend.constant(anchors)
subsample = keras.backend.constant([1, 0, 1])
positive_weight = -1.0
proposed_inside_weights = [1.0, 0.5, 0.7, 1.0]
target_inside_weights = numpy.array(
[[1.0, 0.5, 0.7, 1.0],
[0.0, 0.0, 0.0, 0.0],
[1.0, 0.5, 0.7, 1.0]]
)
target_inside_weights = keras.backend.constant(target_inside_weights)
target_outside_weights = keras.backend.ones_like(anchors, dtype=keras.backend.floatx())
target_outside_weights /= target_outside_weights
output_inside_weights, output_outside_weights = anchor_target.inside_and_outside_weights(anchors, subsample, positive_weight, proposed_inside_weights)
> target_inside_weights = keras.backend.eval(target_inside_weights)
tests/layers/object_detection/test_anchor_target.py:240:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/morteza/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:660: in eval
return to_dense(x).eval(session=get_session())
/home/morteza/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:189: in get_session
[tf.is_variable_initialized(v) for v in candidate_vars])
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:889: in run
run_metadata_ptr)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:1105: in _run
self._graph, fetches, feed_dict_tensor, feed_handles=feed_handles)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:427: in __init__
self._assert_fetchable(graph, fetch.op)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow.python.client.session._FetchHandler object at 0x7f0144471e80>
graph = <tensorflow.python.framework.ops.Graph object at 0x7f0148fbd9b0>
op = <tf.Operation 'IsVariableInitialized_12' type=IsVariableInitialized>
def _assert_fetchable(self, graph, op):
if not graph.is_fetchable(op):
raise ValueError(
> 'Operation %r has been marked as not fetchable.' % op.name)
E ValueError: Operation 'IsVariableInitialized_12' has been marked as not fetchable.
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:440: ValueError
______________________ test_inside_and_outside_weights_2 _______________________
def test_inside_and_outside_weights_2():
anchors = numpy.array(
[[30, 20, 50, 30],
[10, 15, 20, 25],
[ 5, 15, 20, 22]]
)
anchors = keras.backend.constant(anchors)
subsample = keras.backend.constant([1, 0, 1])
positive_weight = 0.6
proposed_inside_weights = [1.0, 0.5, 0.7, 1.0]
target_inside_weights = numpy.array(
[[1.0, 0.5, 0.7, 1.0],
[0.0, 0.0, 0.0, 0.0],
[1.0, 0.5, 0.7, 1.0]]
)
target_inside_weights = keras.backend.constant(target_inside_weights)
target_outside_weights = numpy.array(
[[0.3, 0.3, 0.3, 0.3],
[0.4, 0.4, 0.4, 0.4],
[0.3, 0.3, 0.3, 0.3]]
)
target_outside_weights = keras.backend.constant(target_outside_weights)
output_inside_weights, output_outside_weights = anchor_target.inside_and_outside_weights(anchors, subsample, positive_weight, proposed_inside_weights)
> target_inside_weights = keras.backend.eval(target_inside_weights)
tests/layers/object_detection/test_anchor_target.py:284:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/morteza/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:660: in eval
return to_dense(x).eval(session=get_session())
/home/morteza/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:189: in get_session
[tf.is_variable_initialized(v) for v in candidate_vars])
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:889: in run
run_metadata_ptr)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:1105: in _run
self._graph, fetches, feed_dict_tensor, feed_handles=feed_handles)
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:427: in __init__
self._assert_fetchable(graph, fetch.op)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow.python.client.session._FetchHandler object at 0x7f0144405940>
graph = <tensorflow.python.framework.ops.Graph object at 0x7f0148fbd9b0>
op = <tf.Operation 'IsVariableInitialized_19' type=IsVariableInitialized>
def _assert_fetchable(self, graph, op):
if not graph.is_fetchable(op):
raise ValueError(
> 'Operation %r has been marked as not fetchable.' % op.name)
E ValueError: Operation 'IsVariableInitialized_19' has been marked as not fetchable.
/home/morteza/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py:440: ValueError
=========================== 9 failed in 2.02 seconds ===========================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment