I having this issue - "ImportError: cannot import name '_Conv' from 'keras.layers.convolutional'"
I have the latest version TensorFlow and Keras-vis.
Below is the code,
import os
import cv2
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
import keras
from keras import activations
from keras.models import load_model
from vis.visualization import visualize_cam, overlay
from vis.utils import utils
import matplotlib.cm as cm
visualization = visualize_cam(model, layer_index, filter_indices=input_class, seed_input=input_image)
axes[0].imshow(input_image.squeeze(), cmap='gray')
axes[0].set_title('Input')
axes[1].imshow(visualization)
axes[1].set_title('Grad-CAM')
heatmap = np.uint8(cm.jet(visualization)[..., :3] 255)
original = np.uint8(cm.gray(input_image.squeeze())[..., :3] 255)
axes[2].imshow(overlay(heatmap, original))
axes[2].set_title('Overlay')
fig.suptitle(f'Image Class = {CATEGORIES[input_class]}')
plt.show()
I having this issue - "ImportError: cannot import name '_Conv' from 'keras.layers.convolutional'" I have the latest version TensorFlow and Keras-vis. Below is the code,
import os import cv2 import numpy as np import pandas as pd import matplotlib.pyplot as plt
import tensorflow as tf import keras from keras import activations from keras.models import load_model
from vis.visualization import visualize_cam, overlay from vis.utils import utils import matplotlib.cm as cm visualization = visualize_cam(model, layer_index, filter_indices=input_class, seed_input=input_image) axes[0].imshow(input_image.squeeze(), cmap='gray') axes[0].set_title('Input') axes[1].imshow(visualization) axes[1].set_title('Grad-CAM') heatmap = np.uint8(cm.jet(visualization)[..., :3] 255) original = np.uint8(cm.gray(input_image.squeeze())[..., :3] 255) axes[2].imshow(overlay(heatmap, original)) axes[2].set_title('Overlay') fig.suptitle(f'Image Class = {CATEGORIES[input_class]}') plt.show()
I have attached the screenshot of the error.
Can anyone please help me?