Solution to latex “too many unprocessed floats” error

This error occurred because more than 18 graphs and tables were placed in a row without any text in between.These solutions are available online:
1. Using macro package \usepackage[section]{placeins}
2. Start using \ ClearPage on each pageBut after the author used the above method, although the error is not reported, but the layout of the picture is still a bit messy.

In fact, this error is caused by the continuous placement of too many floating graphics.

The author to check the LaTex books (http://www.ctex.org/documents/latex/graphics/node2.html), 20 according to the book. Do not float the figure, remove the figure environment (that is, add pictures as non-floating graphics), the problem is solved.

Code used by the author:

\centerline{\includegraphics[width=12cm]{fig1}}
\caption{fig1}\label{fig1}
%\vspace{5mm}
\centerline{\includegraphics[width=12cm]{fig2}}
\caption{fig2}\label{fig2}
%\vspace{5mm}
\centerline{\includegraphics[width=12cm]{fig3}}
\caption{fig3}\label{fig3}
.
.
.
%\vspace{5mm}
\centerline{\includegraphics[width=12cm]{fig20}}
\caption{fig20}\label{fig20}

where vspace{5mm} can be adjusted for image spacing.
Update: If you must use the Figure environment, you can combine \ ClearPage with! H parameters are used together, such as:

\begin{figure}[!h]
\centerline{\includegraphics[width=12cm]{fig17}}
\caption{Experimental results of the 17th image frame}\label{fig17}
\end{figure}

\clearpage

\begin{figure}[!h]
\centerline{\includegraphics[width=12cm]{fig18}}
\caption{Experimental results of the 18th image frame}\label{fig18}
\end{figure}

\ ClearPage where it was at the end of the previous page.

Read More: