Advertisement
Guest User

Untitled

a guest
Jun 18th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. Traceback (most recent call last):
  2. File "3.py", line 52, in <module>
  3. heatmap = visualize_saliency(model, layer_idx, [pred_class], x)
  4. 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
  5. opt = Optimizer(model.input, losses, norm_grads=False)
  6. 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__
  7. loss_fn = weight * loss.build_loss()
  8. 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
  9. loss += -K.mean(layer_output[:, idx])
  10. File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 497, in _SliceHelper
  11. name=name)
  12. File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 655, in strided_slice
  13. shrink_axis_mask=shrink_axis_mask)
  14. File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 3568, in strided_slice
  15. shrink_axis_mask=shrink_axis_mask, name=name)
  16. File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 768, in apply_op
  17. op_def=op_def)
  18. File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2338, in create_op
  19. set_shapes_for_outputs(ret)
  20. File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1719, in set_shapes_for_outputs
  21. shapes = shape_func(op)
  22. File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1669, in call_with_requiring
  23. return call_cpp_shape_fn(op, require_shape_fn=True)
  24. File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 610, in call_cpp_shape_fn
  25. debug_python_shape_fn, require_shape_fn)
  26. File "/Users/zhishanzhang/code/ke2/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 676, in _call_cpp_shape_fn_impl
  27. raise ValueError(err.message)
  28. 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