Solved by spanev in post #5 
              
              
                Are you sure that the error comes from make_grid? It might come from imshow as well. Can you try to run it without ax.imshow?