Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Traceback (most recent call last):
- File "3.py", line 52, in <module>
- heatmap = visualize_saliency(model, layer_idx, [pred_class], x)
- File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/keras_vis-0.3.1-py2.7.egg/vis/visualization.py", line 150, in visualize_saliency
- opt = Optimizer(model.input, losses, norm_grads=False)
- File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/keras_vis-0.3.1-py2.7.egg/vis/optimizer.py", line 35, in __init__
- loss_fn = weight * loss.build_loss()
- File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/keras_vis-0.3.1-py2.7.egg/vis/losses.py", line 84, in build_loss
- loss += -K.mean(layer_output[:, idx])
- File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 497, in _SliceHelper
- name=name)
- File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 655, in strided_slice
- shrink_axis_mask=shrink_axis_mask)
- File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 3568, in strided_slice
- shrink_axis_mask=shrink_axis_mask, name=name)
- File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 768, in apply_op
- op_def=op_def)
- File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2338, in create_op
- set_shapes_for_outputs(ret)
- File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1719, in set_shapes_for_outputs
- shapes = shape_func(op)
- File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1669, in call_with_requiring
- return call_cpp_shape_fn(op, require_shape_fn=True)
- File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 610, in call_cpp_shape_fn
- debug_python_shape_fn, require_shape_fn)
- File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 676, in _call_cpp_shape_fn_impl
- raise ValueError(err.message)
- ValueError: slice index 1 of dimension 1 out of bounds. for 'strided_slice_1' (op: 'StridedSlice') with input shapes: [?,1], [2], [2], [2] and with computed input tensors: input[1] = <0 1>, input[2] = <0 2>, input[3] = <1 1>.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement