HarisIqbal88 / PlotNeuralNet

Latex code for making neural networks diagrams
MIT License
21.74k stars 2.84k forks source link

Error when running readme example: `I can't find file `tikzlibraryquotes.code.tex'` #26

Closed JamesOwers closed 5 years ago

JamesOwers commented 5 years ago

python my_arch.py works fine, producing the output included below. However, when I run pdflatex, I get error:

! I can't find file `tikzlibraryquotes.code.tex'.
<argument> ...nput tikzlibrary\pgf@temp .code.tex 
                                                  \catcode `\@ =\csname tikz...
l.2 \usetikzlibrary{quotes,arrows.meta}

I presume this is a simple fix requiring an install. Please may you help me diagnose what I need installed on my system for this to run? I am able to run tikz fine and create examples e.g. this one.

LaTeX info

$ pdflatex --version
pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
kpathsea version 6.1.1
Copyright 2013 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.2.50; using libpng 1.2.50
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with poppler version 0.24.5

Python output:

\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}   

\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]

\pic[shift={(0,0,0)}] at (0,0,0) 
    {Box={
        name=conv1,
        caption= ,
        xlabel={{64, }},
        zlabel=512,
        fill=\ConvColor,
        height=64,
        width=2,
        depth=64
        }
    };

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

\pic[shift={(1,0,0)}] at (pool1-east) 
    {Box={
        name=conv2,
        caption= ,
        xlabel={{64, }},
        zlabel=128,
        fill=\ConvColor,
        height=32,
        width=2,
        depth=32
        }
    };

\draw [connection]  (pool1-east)    -- node {\midarrow} (conv2-west);

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

\pic[shift={(3,0,0)}] at (pool1-east) 
    {Box={
        name=soft1,
        caption=SOFT,
        xlabel={{" ","dummy"}},
        zlabel=10,
        fill=\SoftmaxColor,
        opacity=0.8,
        height=3,
        width=1.5,
        depth=25
        }
    };

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

\end{tikzpicture}
\end{document}
JamesOwers commented 5 years ago

Yes, it was as I suspected, my tex live installation is super old. Here's how I solved my problem:

  1. download texlive 2018 https://www.tug.org/texlive/acquire-netinstall.html
  2. follow install instructions https://www.tug.org/texlive/quickinstall.html
    1. additionally, this actually required that I sudo mkdir /usr/local/texlive & chmod 777 /usr/local/texlive to enable writing to the required directory
    2. this takes 15 mins or so, so make a cup of tea
  3. Don't forget to add the binaries to your path, e.g. add export PATH=/usr/local/texlive/2018/bin/x86_64-linux:$PATH to your ~/.bashrc
  4. source ~/.bashrc now run pdflatex --version to check the changes have been applied

Notes

The platform I'm using is Linux and the distribution is Linux Mint 17 Rafaella - that's pretty close to Ubuntu

John1231983 commented 5 years ago

Hi. Thanks for great work. I also got the error. Does it mean I need to install texliv?


 File "my_arch.py", line 2
 \end{tikzpicture}
\end{document}

This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./my_arch.tex
LaTeX2e <2016/02/01>
Babel <3.9q> and hyphenation patterns for 3 language(s) loaded.

! LaTeX Error: File `standalone.cls' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)
csijun commented 5 years ago

Hi. Thanks for great work. I also got the error. Does it mean I need to install texliv?


 File "my_arch.py", line 2
 \end{tikzpicture}
\end{document}

This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./my_arch.tex
LaTeX2e <2016/02/01>
Babel <3.9q> and hyphenation patterns for 3 language(s) loaded.

! LaTeX Error: File `standalone.cls' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)

Hi, I got the same problem. How do you solve?

John1231983 commented 5 years ago

Install texlive extra for ubuntu

csijun commented 5 years ago

Install texlive extra for ubuntu

thanks , I trying.

John1231983 commented 5 years ago

This one sudo apt-get install texlive-latex-extra

Ysoleil commented 5 years ago

hello!Thank you for sharing. But I have the same problem. My system is Windows. Download the installation package for 2018, I don't know how to deal with this problem.

C:\Users\lenovo>tex -version MiKTeX-TeX 2.9.3759 (3.1415926) (MiKTeX 2.9) Copyright (C) 1982 by D. E. Knuth; all rights are reserved. TeX is a trademark of the American Mathematical Society.

C:\Users\lenovo>pdflatex --version MiKTeX-pdfTeX 2.9.4307 (1.40.12) (MiKTeX 2.9) Copyright (C) 1982 D. E. Knuth, (C) 1996-2006 Han The Thanh TeX is a trademark of the American Mathematical Society.

The error: I can't find file `tikzlibraryquotes.code.tex'. \usetikzlibrary{quotes,arrows.meta} Emergency stop. \usetikzlibrary{quotes,arrows.meta}

I hope I haven't disturbed you. Thank you. @JamesOwers @John1231983

JamesOwers commented 5 years ago

@John1231983 @Ysoleil - you both just need to install Tex Live on your system. Follow the instructions to do so on their website (I provide a link above!).