HarisIqbal88 / PlotNeuralNet

Latex code for making neural networks diagrams
MIT License
22.23k stars 2.88k forks source link

.PDF file is generated but cant get the tex codes, the error information is given as follows/ #158

Open MadadamXie opened 2 months ago

MadadamXie commented 2 months ago

\documentclass[border=8pt, multi, tikz]{standalone} \usepackage{import} \subimport{../layers/}{init} \usetikzlibrary{positioning} \usetikzlibrary{3d} %for including external image

\def\ConvColor{rgb:yellow,5;red,2.5;white,5} \def\ConvReluColor{rgb:yellow,5;red,5;white,5} \def\PoolColor{rgb:red,1;black,0.3} \def\UnpoolColor{rgb:blue,2;green,1;black,0.3} \def\FcColor{rgb:blue,5;red,2.5;white,5} \def\FcReluColor{rgb:blue,5;red,5;white,4} \def\SoftmaxColor{rgb:magenta,5;black,7}
\def\SumColor{rgb:blue,5;green,15}

\newcommand{\copymidarrow}{\tikz \draw[-Stealth,line width=0.8mm,draw={rgb:blue,4;red,1;green,1;black,3}] (-0.3,0) -- ++(0.3,0);}

\begin{document} \begin{tikzpicture} \tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\edgecolor,opacity=0.7] \tikzstyle{copyconnection}=[ultra thick,every node/.style={sloped,allow upside down},draw={rgb:blue,4;red,1;green,1;black,3},opacity=0.7]

\node[canvas is zy plane at x=0] (temp) at (-3,0,0) {\includegraphics[width=8cm,height=8cm]{../examples/fcn8s/cats.jpg}};

\pic[shift={ (0,0,0) }] at (0,0,0) {RightBandedBox={ name=ccr_b1, caption= , xlabel={{ 64, 64 }}, zlabel=500, fill=\ConvColor, bandfill=\ConvReluColor, height=40, width={ 2 , 2 }, depth=40 } };

\pic[shift={ (0,0,0) }] at (ccr_b1-east) {Box={ name=pool_b1, caption= , fill=\PoolColor, opacity=0.5, height=32, width=1, depth=32 } };

\pic[shift={ (1,0,0) }] at (pool_b1-east) {RightBandedBox={ name=ccr_b2, caption= , xlabel={{ 128, 128 }}, zlabel=256, fill=\ConvColor, bandfill=\ConvReluColor, height=32, width={ 3.5 , 3.5 }, depth=32 } };

\pic[shift={ (0,0,0) }] at (ccr_b2-east) {Box={ name=pool_b2, caption= , fill=\PoolColor, opacity=0.5, height=24, width=1, depth=24 } };

\draw [connection] (pool_b1-east) -- node {\midarrow} (ccr_b2-west);

\pic[shift={ (1,0,0) }] at (pool_b2-east) {RightBandedBox={ name=ccr_b3, caption= , xlabel={{ 256, 256 }}, zlabel=128, fill=\ConvColor, bandfill=\ConvReluColor, height=25, width={ 4.5 , 4.5 }, depth=25 } };

\pic[shift={ (0,0,0) }] at (ccr_b3-east) {Box={ name=pool_b3, caption= , fill=\PoolColor, opacity=0.5, height=19, width=1, depth=19 } };

\draw [connection] (pool_b2-east) -- node {\midarrow} (ccr_b3-west);

\pic[shift={ (1,0,0) }] at (pool_b3-east) {RightBandedBox={ name=ccr_b4, caption= , xlabel={{ 512, 512 }}, zlabel=64, fill=\ConvColor, bandfill=\ConvReluColor, height=16, width={ 5.5 , 5.5 }, depth=16 } };

\pic[shift={ (0,0,0) }] at (ccr_b4-east) {Box={ name=pool_b4, caption= , fill=\PoolColor, opacity=0.5, height=12, width=1, depth=12 } };

\draw [connection] (pool_b3-east) -- node {\midarrow} (ccr_b4-west);

\pic[shift={ (2,0,0) }] at (pool_b4-east) {RightBandedBox={ name=ccr_b5, caption=Bottleneck, xlabel={{ 1024, 1024 }}, zlabel=32, fill=\ConvColor, bandfill=\ConvReluColor, height=8, width={ 8 , 8 }, depth=8 } };

\draw [connection] (pool_b4-east) -- node {\midarrow} (ccr_b5-west);

\pic[shift={ (2.1,0,0) }] at (ccr_b5-east) {Box={ name=unpool_b6, caption= , fill=\UnpoolColor, opacity=0.5, height=16, width=1, depth=16 } };

\pic[shift={ (0,0,0) }] at (unpool_b6-east) {RightBandedBox={ name=ccr_res_b6, caption= , xlabel={{ 512, }}, zlabel=64, fill={rgb:white,1;black,3}, bandfill={rgb:white,1;black,2}, opacity=0.5, height=16, width=5.0, depth=16 } };

\pic[shift={(0,0,0)}] at (ccr_res_b6-east) {Box={ name=ccr_b6, caption= , xlabel={{512, }}, zlabel=64, fill=\ConvColor, height=16, width=5.0, depth=16 } };

\pic[shift={ (0,0,0) }] at (ccr_b6-east) {RightBandedBox={ name=ccr_res_c_b6, caption= , xlabel={{ 512, }}, zlabel=64, fill={rgb:white,1;black,3}, bandfill={rgb:white,1;black,2}, opacity=0.5, height=16, width=5.0, depth=16 } };

\pic[shift={(0,0,0)}] at (ccr_res_c_b6-east) {Box={ name=end_b6, caption= , xlabel={{512, }}, zlabel=64, fill=\ConvColor, height=16, width=5.0, depth=16 } };

\draw [connection] (ccr_b5-east) -- node {\midarrow} (unpool_b6-west);

\path (ccr_b4-southeast) -- (ccr_b4-northeast) coordinate[pos=1.25] (ccr_b4-top) ; \path (ccr_res_b6-south) -- (ccr_res_b6-north) coordinate[pos=1.25] (ccr_res_b6-top) ; \draw [copyconnection] (ccr_b4-northeast)
-- node {\copymidarrow}(ccr_b4-top) -- node {\copymidarrow}(ccr_res_b6-top) -- node {\copymidarrow} (ccr_res_b6-north);

\pic[shift={ (2.1,0,0) }] at (end_b6-east) {Box={ name=unpool_b7, caption= , fill=\UnpoolColor, opacity=0.5, height=25, width=1, depth=25 } };

\pic[shift={ (0,0,0) }] at (unpool_b7-east) {RightBandedBox={ name=ccr_res_b7, caption= , xlabel={{ 256, }}, zlabel=128, fill={rgb:white,1;black,3}, bandfill={rgb:white,1;black,2}, opacity=0.5, height=25, width=4.5, depth=25 } };

\pic[shift={(0,0,0)}] at (ccr_res_b7-east) {Box={ name=ccr_b7, caption= , xlabel={{256, }}, zlabel=128, fill=\ConvColor, height=25, width=4.5, depth=25 } };

\pic[shift={ (0,0,0) }] at (ccr_b7-east) {RightBandedBox={ name=ccr_res_c_b7, caption= , xlabel={{ 256, }}, zlabel=128, fill={rgb:white,1;black,3}, bandfill={rgb:white,1;black,2}, opacity=0.5, height=25, width=4.5, depth=25 } };

\pic[shift={(0,0,0)}] at (ccr_res_c_b7-east) {Box={ name=end_b7, caption= , xlabel={{256, }}, zlabel=128, fill=\ConvColor, height=25, width=4.5, depth=25 } };

\draw [connection] (end_b6-east) -- node {\midarrow} (unpool_b7-west);

\path (ccr_b3-southeast) -- (ccr_b3-northeast) coordinate[pos=1.25] (ccr_b3-top) ; \path (ccr_res_b7-south) -- (ccr_res_b7-north) coordinate[pos=1.25] (ccr_res_b7-top) ; \draw [copyconnection] (ccr_b3-northeast)
-- node {\copymidarrow}(ccr_b3-top) -- node {\copymidarrow}(ccr_res_b7-top) -- node {\copymidarrow} (ccr_res_b7-north);

\pic[shift={ (2.1,0,0) }] at (end_b7-east) {Box={ name=unpool_b8, caption= , fill=\UnpoolColor, opacity=0.5, height=32, width=1, depth=32 } };

\pic[shift={ (0,0,0) }] at (unpool_b8-east) {RightBandedBox={ name=ccr_res_b8, caption= , xlabel={{ 128, }}, zlabel=256, fill={rgb:white,1;black,3}, bandfill={rgb:white,1;black,2}, opacity=0.5, height=32, width=3.5, depth=32 } };

\pic[shift={(0,0,0)}] at (ccr_res_b8-east) {Box={ name=ccr_b8, caption= , xlabel={{128, }}, zlabel=256, fill=\ConvColor, height=32, width=3.5, depth=32 } };

\pic[shift={ (0,0,0) }] at (ccr_b8-east) {RightBandedBox={ name=ccr_res_c_b8, caption= , xlabel={{ 128, }}, zlabel=256, fill={rgb:white,1;black,3}, bandfill={rgb:white,1;black,2}, opacity=0.5, height=32, width=3.5, depth=32 } };

\pic[shift={(0,0,0)}] at (ccr_res_c_b8-east) {Box={ name=end_b8, caption= , xlabel={{128, }}, zlabel=256, fill=\ConvColor, height=32, width=3.5, depth=32 } };

\draw [connection] (end_b7-east) -- node {\midarrow} (unpool_b8-west);

\path (ccr_b2-southeast) -- (ccr_b2-northeast) coordinate[pos=1.25] (ccr_b2-top) ; \path (ccr_res_b8-south) -- (ccr_res_b8-north) coordinate[pos=1.25] (ccr_res_b8-top) ; \draw [copyconnection] (ccr_b2-northeast)
-- node {\copymidarrow}(ccr_b2-top) -- node {\copymidarrow}(ccr_res_b8-top) -- node {\copymidarrow} (ccr_res_b8-north);

\pic[shift={ (2.1,0,0) }] at (end_b8-east) {Box={ name=unpool_b9, caption= , fill=\UnpoolColor, opacity=0.5, height=40, width=1, depth=40 } };

\pic[shift={ (0,0,0) }] at (unpool_b9-east) {RightBandedBox={ name=ccr_res_b9, caption= , xlabel={{ 64, }}, zlabel=512, fill={rgb:white,1;black,3}, bandfill={rgb:white,1;black,2}, opacity=0.5, height=40, width=2.5, depth=40 } };

\pic[shift={(0,0,0)}] at (ccr_res_b9-east) {Box={ name=ccr_b9, caption= , xlabel={{64, }}, zlabel=512, fill=\ConvColor, height=40, width=2.5, depth=40 } };

\pic[shift={ (0,0,0) }] at (ccr_b9-east) {RightBandedBox={ name=ccr_res_c_b9, caption= , xlabel={{ 64, }}, zlabel=512, fill={rgb:white,1;black,3}, bandfill={rgb:white,1;black,2}, opacity=0.5, height=40, width=2.5, depth=40 } };

\pic[shift={(0,0,0)}] at (ccr_res_c_b9-east) {Box={ name=end_b9, caption= , xlabel={{64, }}, zlabel=512, fill=\ConvColor, height=40, width=2.5, depth=40 } };

\draw [connection] (end_b8-east) -- node {\midarrow} (unpool_b9-west);

\path (ccr_b1-southeast) -- (ccr_b1-northeast) coordinate[pos=1.25] (ccr_b1-top) ; \path (ccr_res_b9-south) -- (ccr_res_b9-north) coordinate[pos=1.25] (ccr_res_b9-top) ; \draw [copyconnection] (ccr_b1-northeast)
-- node {\copymidarrow}(ccr_b1-top) -- node {\copymidarrow}(ccr_res_b9-top) -- node {\copymidarrow} (ccr_res_b9-north);

\pic[shift={(0.75,0,0)}] at (end_b9-east) {Box={ name=soft1, caption=SOFT, zlabel=512, fill=\SoftmaxColor, height=40, width=1, depth=40 } };

\draw [connection] (end_b9-east) -- node {\midarrow} (soft1-west);

\end{tikzpicture} \end{document}

This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (./unet.tex LaTeX2e <2021-11-15> patch level 1 L3 programming layer <2022-01-21> (/usr/share/texlive/texmf-dist/tex/latex/standalone/standalone.cls Document Class: standalone 2018/03/26 v1.3a Class to compile TeX sub-files stan dalone (/usr/share/texlive/texmf-dist/tex/latex/tools/shellesc.sty) (/usr/share/texlive/texmf-dist/tex/generic/iftex/ifluatex.sty (/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty)) (/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (/usr/share/texlive/texmf-dist/tex/latex/standalone/standalone.cfg) (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2021/10/04 v1.4n Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo)) (/usr/share/texlive/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty (/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty (/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.t ex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/pgf.revision.tex))) (/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg) (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def))) (/usr/share/texlive/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.t ex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.de f))) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code. tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code. tex)) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code .tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonomet ric.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.cod e.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison .code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code. tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code .tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code. tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerari thmetics.code.tex))) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfint.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.te x) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct. code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code .tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.te x) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.c ode.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformation s.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.t ex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing .code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.te x) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex

(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code. tex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.te x) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.c ode.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code. tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex)) ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex ) (/usr/share/texlive/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65 .sty) (/usr/share/texlive/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18 .sty)) (/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgffor.sty (/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex)) (/usr/share/texlive/texmf-dist/tex/latex/pgf/math/pgfmath.sty (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex))) (/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex

(/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers .code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik zlibrarytopaths.code.tex)))) (/usr/share/texlive/texmf-dist/tex/latex/import/import.sty) (../layers/../layers/init.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik zlibraryquotes.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.meta. code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik zlibrarypositioning.code.tex) (../layers/../layers//Ball.sty

LaTeX Warning: You have requested package ../layers//Ball', but the package providesBall'.

) (../layers/../layers//Box.sty

LaTeX Warning: You have requested package ../layers//Box', but the package providesBox'.

) (../layers/../layers//RightBandedBox.sty

LaTeX Warning: You have requested package ../layers//RightBandedBox', but the package providesRightBandedBox'.

)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik zlibrary3d.code.tex) (/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def) No file unet.aux. (/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] ) (/usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg)) Overfull \hbox (15.26395pt too wide) in paragraph at lines 470--470 [][][]\OT1/cmr/bx/n/10 SOFT[] [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map} <../examples/fcn8s/cats.j pg>] (./unet.aux) ) (see the transcript file for additional information)</usr/share/texlive/texmf-d ist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></usr/share/texlive/texmf-dist/fo nts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texlive/texmf-dist/fonts/typ e1/public/amsfonts/cm/cmr9.pfb> Output written on unet.pdf (1 page, 103226 bytes). Transcript written on unet.log. rm: can't remove '*.vscodeLog': no such file or directory.

MadadamXie commented 2 months ago

I got it, just to modify the sh file and everything is fine.