If I remove the indexing in the imshow in defintion then I still get the same error. And if I remove indexing in the visualize_model function then I get the following output…

error in visualization.jpg713×747 35.7 KB