You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`raceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\framework\ops.py", line 1607, in _create_c_op
c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: slice index 20 of dimension 1 out of bounds. for 'strided_slice' (op: 'StridedSlice') with input shapes: [?,7], [2], [2], [2] and with computed input tensors: input[1] = <0 20>, input[2] = <0 21>, input[3] = <1 1>.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:/Projects/Visualization/visual.py", line 37, in
seed_input=img, backprop_modifier=modifier)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\vis\visualization\saliency.py", line 134, in visualize_saliency
return visualize_saliency_with_losses(model.input, losses, seed_input, wrt_tensor, grad_modifier, keepdims)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\vis\visualization\saliency.py", line 78, in visualize_saliency_with_losses
opt = Optimizer(input_tensor, losses, wrt_tensor=wrt_tensor, norm_grads=False)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\vis\optimizer.py", line 52, in init
loss_fn = weight * loss.build_loss()
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\vis\losses.py", line 84, in build_loss
loss += -K.mean(layer_output[:, idx])
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\ops\array_ops.py", line 802, in _slice_helper
name=name)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\ops\array_ops.py", line 968, in strided_slice
shrink_axis_mask=shrink_axis_mask)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\ops\gen_array_ops.py", line 10392, in strided_slice
shrink_axis_mask=shrink_axis_mask, name=name)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\framework\op_def_library.py", line 794, in _apply_op_helper
op_def=op_def)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\util\deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3357, in create_op
attrs, op_def, compute_device)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3426, in _create_op_internal
op_def=op_def)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\framework\ops.py", line 1770, in init
control_input_ops)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\framework\ops.py", line 1610, in _create_c_op
raise ValueError(str(e))
ValueError: slice index 20 of dimension 1 out of bounds. for 'strided_slice' (op: 'StridedSlice') with input shapes: [?,7], [2], [2], [2] and with computed input tensors: input[1] = <0 20>, input[2] = <0 21>, input[3] = <1 1>.
`
The text was updated successfully, but these errors were encountered:
Hello,
I'm getting trouble in using keras-vis for visualizing attention of the model.
Below is my model's architecture:
input_1 (InputLayer) (None, 224, 224, 3) 0
block1_conv1 (Conv2D) (None, 224, 224, 64) 1792
block1_conv2 (Conv2D) (None, 224, 224, 64) 36928
block1_pool (MaxPooling2D) (None, 112, 112, 64) 0
block2_conv1 (Conv2D) (None, 112, 112, 128) 73856
block2_conv2 (Conv2D) (None, 112, 112, 128) 147584
block2_pool (MaxPooling2D) (None, 56, 56, 128) 0
block3_conv1 (Conv2D) (None, 56, 56, 256) 295168
block3_conv2 (Conv2D) (None, 56, 56, 256) 590080
block3_conv3 (Conv2D) (None, 56, 56, 256) 590080
block3_pool (MaxPooling2D) (None, 28, 28, 256) 0
block4_conv1 (Conv2D) (None, 28, 28, 512) 1180160
block4_conv2 (Conv2D) (None, 28, 28, 512) 2359808
block4_conv3 (Conv2D) (None, 28, 28, 512) 2359808
block4_pool (MaxPooling2D) (None, 14, 14, 512) 0
block5_conv1 (Conv2D) (None, 14, 14, 512) 2359808
block5_conv2 (Conv2D) (None, 14, 14, 512) 2359808
block5_conv3 (Conv2D) (None, 14, 14, 512) 2359808
block5_pool (MaxPooling2D) (None, 7, 7, 512) 0
flatten (Flatten) (None, 25088) 0
fc1 (Dense) (None, 256) 6422784
dropout_1 (Dropout) (None, 256) 0
predictions (Dense) (None, 7) 1799
and I received this error :
`raceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\framework\ops.py", line 1607, in _create_c_op
c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: slice index 20 of dimension 1 out of bounds. for 'strided_slice' (op: 'StridedSlice') with input shapes: [?,7], [2], [2], [2] and with computed input tensors: input[1] = <0 20>, input[2] = <0 21>, input[3] = <1 1>.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:/Projects/Visualization/visual.py", line 37, in
seed_input=img, backprop_modifier=modifier)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\vis\visualization\saliency.py", line 134, in visualize_saliency
return visualize_saliency_with_losses(model.input, losses, seed_input, wrt_tensor, grad_modifier, keepdims)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\vis\visualization\saliency.py", line 78, in visualize_saliency_with_losses
opt = Optimizer(input_tensor, losses, wrt_tensor=wrt_tensor, norm_grads=False)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\vis\optimizer.py", line 52, in init
loss_fn = weight * loss.build_loss()
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\vis\losses.py", line 84, in build_loss
loss += -K.mean(layer_output[:, idx])
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\ops\array_ops.py", line 802, in _slice_helper
name=name)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\ops\array_ops.py", line 968, in strided_slice
shrink_axis_mask=shrink_axis_mask)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\ops\gen_array_ops.py", line 10392, in strided_slice
shrink_axis_mask=shrink_axis_mask, name=name)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\framework\op_def_library.py", line 794, in _apply_op_helper
op_def=op_def)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\util\deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3357, in create_op
attrs, op_def, compute_device)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3426, in _create_op_internal
op_def=op_def)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\framework\ops.py", line 1770, in init
control_input_ops)
File "C:\ProgramData\Anaconda3\envs\Projects\lib\site-packages\tensorflow_core\python\framework\ops.py", line 1610, in _create_c_op
raise ValueError(str(e))
ValueError: slice index 20 of dimension 1 out of bounds. for 'strided_slice' (op: 'StridedSlice') with input shapes: [?,7], [2], [2], [2] and with computed input tensors: input[1] = <0 20>, input[2] = <0 21>, input[3] = <1 1>.
`
The text was updated successfully, but these errors were encountered: