Installation
Prior to installing, have a glance through this guide and take note of the details for your platform. We install and run Caffe on Ubuntu 16.04–12.04, OS X 10.11–10.8, and through Docker and AWS. The official Makefile and Makefile.config build are complemented by a community CMake build.
Step-by-step Instructions:
- Docker setupout-of-the-box brewing
- Ubuntu installationthe standard platform
- Debian installationinstall caffe with a single command
- OS X installation
- RHEL / CentOS / Fedora installation
- Windowssee the Windows branch led by Guillaume Dumont
- OpenCLsee the OpenCL branch led by Fabian Tschopp
- AWS AMIpre-configured for AWS
Overview:
When updating Caffe, it’s best to make clean before re-compiling.
Prerequisites
Caffe has several dependencies:
- CUDA is required for GPU mode.
- library version 7+ and the latest driver version are recommended, but 6.* is fine too
- 5.5, and 5.0 are compatible but considered legacy
- OpenCV >= 2.4 including 3.0
- IO libraries: lmdb , leveldb (note: leveldb requires snappy )
- cuDNN for GPU acceleration (v6)
Pycaffe and Matcaffe interfaces have their own natural needs.
- For Python Caffe: Python 2.7 or Python 3.3+ , numpy (>= 1.7) , boost-provided boost.python
- For MATLAB Caffe: MATLAB with the mex compiler.
cuDNN Caffe: for fastest operation Caffe is accelerated by drop-in integration of NVIDIA cuDNN. To speed up your Caffe models, install cuDNN then uncomment the USE_CUDNN := 1 flag in Makefile.config when installing Caffe. Acceleration is automatic. The current version is cuDNN v6; older versions are supported in older Caffe.
CPU-only Caffe: for cold-brewed CPU-only Caffe uncomment the CPU_ONLY := 1 flag in Makefile.config to configure and build Caffe without CUDA. This is helpful for cloud or cluster deployment.
CUDA and BLAS
Caffe requires the CUDA nvcc compiler to compile its GPU code and CUDA driver for GPU operation. To install CUDA, go to the NVIDIA CUDA website and follow installation instructions there. Install the library and the latest standalone driver separately; the driver bundled with the library is usually out-of-date. Warning! The 331.* CUDA driver series has a critical performance issue: do not use it.
For best performance, Caffe can be accelerated by NVIDIA cuDNN. Register for free at the cuDNN site, install it, then continue with these installation instructions. To compile with cuDNN set the USE_CUDNN := 1 flag set in your Makefile.config .
Caffe requires BLAS as the backend of its matrix and vector computations. There are several implementations of this library. The choice is yours:
- ATLAS: free, open source, and so the default for Caffe.
- Intel MKL: commercial and optimized for Intel CPUs, with free licenses.
- Install MKL.
- Set up MKL environment (Details: Linux, OS X). Example: source /opt/intel/mkl/bin/mklvars.sh intel64
- Set BLAS := mkl in Makefile.config
- OpenBLAS: free and open source; this optimized and parallel BLAS could require more effort to install, although it might offer a speedup.
- Install OpenBLAS
- Set BLAS := open in Makefile.config
Python and/or MATLAB Caffe (optional)
Python
The main requirements are numpy and boost.python (provided by boost). pandas is useful too and needed for some examples.
You can install the dependencies with
for req in $(cat requirements.txt); do pip install $req; donebut we suggest first installing the Anaconda Python distribution, which provides most of the necessary packages, as well as the hdf5 library dependency.
To import the caffe Python module after completing the installation, add the module directory to your $PYTHONPATH by export PYTHONPATH=/path/to/caffe/python:$PYTHONPATH or the like. You should not import the module in the caffe/python/caffe directory!
Caffe’s Python interface works with Python 2.7. Python 3.3+ should work out of the box without protobuf support. For protobuf support please install protobuf 3.0 alpha (https://developers.google.com/protocol-buffers/). Earlier Pythons are your own adventure.
MATLAB
Install MATLAB, and make sure that its mex is in your $PATH .
Caffe’s MATLAB interface works with versions 2015a, 2014a/b, 2013a/b, and 2012b.
Compilation
Caffe can be compiled with either Make or CMake. Make is officially supported while CMake is supported by the community.
Compilation with Make
Configure the build by copying and modifying the example Makefile.config for your setup. The defaults should work, but uncomment the relevant lines if using Anaconda Python.
cp Makefile.config.example Makefile.config # Adjust Makefile.config (for example, if using Anaconda Python, or if cuDNN is desired) make all make test make runtest- For CPU & GPU accelerated Caffe, no changes are needed.
- For cuDNN acceleration using NVIDIA’s proprietary cuDNN software, uncomment the USE_CUDNN := 1 switch in Makefile.config . cuDNN is sometimes but not always faster than Caffe’s GPU acceleration.
- For CPU-only Caffe, uncomment CPU_ONLY := 1 in Makefile.config .
To compile the Python and MATLAB wrappers do make pycaffe and make matcaffe respectively. Be sure to set your MATLAB and Python paths in Makefile.config first!
Distribution: run make distribute to create a distribute directory with all the Caffe headers, compiled libraries, binaries, etc. needed for distribution to other machines.
Speed: for a faster build, compile in parallel by doing make all -j8 where 8 is the number of parallel threads for compilation (a good choice for the number of threads is the number of cores in your machine).
Now that you have installed Caffe, check out the MNIST tutorial and the reference ImageNet model tutorial.
CMake Build
In lieu of manually editing Makefile.config to configure the build, Caffe offers an unofficial CMake build thanks to @Nerei, @akosiorek, and other members of the community. It requires CMake version >= 2.8.7. The basic steps are as follows:
mkdir build cd build cmake .. make all make install make runtestSee PR #1667 for options and details.
Hardware
Laboratory Tested Hardware: Berkeley Vision runs Caffe with Titan Xs, K80s, GTX 980s, K40s, K20s, Titans, and GTX 770s including models at ImageNet/ILSVRC scale. We have not encountered any trouble in-house with devices with CUDA capability >= 3.0. All reported hardware issues thus-far have been due to GPU configuration, overheating, and the like.
Once installed, check your times against our reference performance numbers to make sure everything is configured properly.
Ask hardware questions on the caffe-users group.
Как установить matlab
You must have three things to run Ghostscript:
- The Ghostscript executable file; on some operating systems, more than one file is required. These are entirely platform-specific. See below for details.
- Initialization files that Ghostscript reads in when it starts up; these are the same on all platforms.
- gs_ * .ps unless Ghostscript was compiled using the «compiled initialization files» option. See the documentation of PostScript files distributed with Ghostscript.
- pdf_ * .ps if Ghostscript was compiled with the ability to interpret Adobe Portable Document Format (PDF) files, that is, pdf.dev was included in FEATURE_DEVS when Ghostscript was built.
- Fontmap and Fontmap.GS (or the appropriate Fontmap. xxx for your platform), unless you plan always to invoke Ghostscript with the -dNOFONTMAP switch.
- Fonts, for rendering text. These are platform-independent, but if you already have fonts of the right kind on your platform, you may be able to use those. See below for details. Also see the documentation on fonts.
The usage documentation describes the search algorithms used to find initialization files and font files. The per-platform descriptions that follow tell you where to install these files.
Installing Ghostscript on Unix
Ghostscript uses the common configure, build and install method common to many modern software packages. In general the following with suffice to build ghostscript:
./configure
makeand then it may be installed in the default location with:
make install
This last command may need to be performed with super user privileges.
You can set the installation directory by adding —prefix=path to the configure invocation in the first step. The default prefix is /usr/local , which is to say the gs executable is installed as /usr/local/bin/gs .
A list of similar configuration options is available via ./configure —help
For more detailed information on building Ghostscript see how to build Ghostscript on Unix in the documentation on building Ghostscript, especially regarding information on using the older hand edited makefile approach. Whatever configuration method you use, execute » make install » to install the executable and all the required and ancillary files after the build is complete.
Fonts
The makefile installs all the files except fonts under the directory defined in the makefile as prefix . Fonts need to be installed separately. The fonts should be installed in /share/ghostscript/fonts . (That is, /usr/local/share/ghostscript/fonts/ if you used the default configuration above.)
If you have Adobe Acrobat installed, you can use the Acrobat fonts in place of the ones distributed with with Ghostscript by adding the Acrobat fonts directory to GS_FONTPATH and removing these fonts from Fontmap.GS :
Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique, Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique, Symbol, Times-Bold, Times-BoldItalic, Times-Italic, Times-Roman, ZapfDingbats
Similarly, you can have ghostscript use other fonts on your system by adding entries to the fontmap or adding the directories to the GS_FONTMAP environment variable. See the usage documentation for more information.
For example, many linux distributions place fonts under /usr/share/fonts .
Ghostscript as a shared object
If you’ve built Ghostscript as a shared object, instead of ‘ make install ‘, you must use ‘ make soinstall ‘. See how to build Ghostscript as a shared object for more details.
Additional notes on Linux
For Linux, you may be able to install or upgrade Ghostscript from precompiled RPM files using:
rpm -U ghostscript-N.NN-1.i386.rpm
rpm -U ghostscript-fonts-N.NN-1.noarch.rpmHowever, please note that we do not create RPMs for Ghostscript, and we take no responsibility for RPMs created by others.
Installing Ghostscript on MS Windows
We usually distribute Ghostscript releases for Windows as a binary installer, for the convenience of most users.
Windows 3.1 (16-bit)
The last version to run on 16-bit Windows 3.1 was Ghostscript 4.03.
Windows 95, 98, Me
The last version to be available as a binary for Windows 95/98/Me was 8.60. Although building from source with Visual Studio 2003 should produce a working binary for those versions.
Windows NT4, 2000, XP, 2003 or Vista (32-bit)
The installer is normally named gs###w32.exe , where ### is the release number (e.g., 871 for Ghostscript 8.71, 910 for Ghostscript 9.10).
Windows XP x64 edition, 2003 or Vista (64-bit)
The x64 installer is normally named gs###w64.exe This is for 64-bit Windows operating systems based on the x64 instruction set. Do not use this on 64-bit processors running 32-bit Windows.
Installing
To install Ghostscript on Windows, you should run the installer executable.
The installer is NSIS-based (see also Release.htm) and supports a few standard NSIS options: /NCRC disables the CRC check, /S runs the installer or uninstaller silently, /D sets the default installation directory (It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces. Only absolute paths are supported).
General Windows configuration
The installer includes files in these subdirectories:
gs#.##\bin
gs#.##\examples
gs#.##\lib
gs#.##\doc
gs#.##\Resource
fontsThe actual executable files for the 32-bit Windows install, in the gs#.##\bin subdirectory, are:
GSWIN32C.EXE Ghostscript as a 32-bit Windows command line program. This is usually the preferred executable. GSWIN32.EXE 32-bit Ghostscript using its own window for commands GSDLL32.DLL 32-bit dynamic link library containing most of Ghostscript’s functionality For the 64-bit Windows install, also in the gs#.##\bin subdirectory, they are:
GSWIN64C.EXE Ghostscript as a 64-bit Windows command line program. This is usually the preferred executable. GSWIN64.EXE 64-bit Ghostscript using its own window for commands GSDLL64.DLL 64-bit dynamic link library containing most of Ghostscript’s functionality For printer devices, the default output is the default printer. This can be modified as follows:
-sOutputFile=»%printer%printer name» Output to the named printer. If your printer is named «HP DeskJet 500″ then you would use -sOutputFile=»%printer%HP DeskJet 500» .
If Ghostscript fails to find an environment variable, it looks for a registry value of the same name under the key
HKEY_CURRENT_USER\Software\GPL Ghostscript\#.##
or if that fails, under the key
HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript\#.##
where #.## is the Ghostscript version number.
Ghostscript will attempt to load the Ghostscript dynamic link library GSDLL32.DLL in the following order:
- In the same directory as the Ghostscript executable.
- If the environment variable GS_DLL is defined, Ghostscript tries to load the Ghostscript dynamic link library (DLL) with the name given.
- Using the standard Windows library search method: the directory from which the application loaded, the current directory, the Windows system directory, the Windows directory and the directories listed in the PATH environment variable.
The Ghostscript installer will create registry values for the environment variables GS_LIB and GS_DLL .
Uninstalling Ghostscript on Windows
To uninstall Ghostscript, use the Control Panel, Add/Remove Programs and remove «Ghostscript #.##» and «Ghostscript Fonts». (The entries may be called «GPL Ghostscript» or «AFPL Ghostscript», rather than just «Ghostscript», depending on what version of Ghostscript was installed). Alternatively, an uninstall shortcut is also available in the Start Menu group.
Installing Ghostscript on OpenVMS
Support for OpenVMS has stagnated (and almost certainly bit-rotted), and as the core development team has no access to an OpenVMS environment, we are unable to bring it up to date. We will consider patches from contributors if any wish to take on the task of getting it working again. Given the very limited appeal of OpenVMS these days, however, we are unlikely to consider patches with invasive code changes.
You need the file GS.EXE to run Ghostscript on OpenVMS, and installing Ghostscript on an OpenVMS system requires building it first: please read how to build Ghostscript on VMS in the documentation on building Ghostscript.
The following installation steps assume that the Ghostscript directory is DISK1:[DIR.GHOSTSCRIPT] . Yours will almost certainly be in a different location so adjust the following commands accordingly.
- Download the fonts and unpack them into DISK1:[DIR.GHOSTSCRIPT.LIB] .
- Enable access to the program and support files for all users with:
$ set file/prot=w:re DISK1:[DIR]GHOSTSCRIPT.dir $ set file/prot=w:re DISK1:[DIR.GHOSTSCRIPT. ]*.*
$ lib/help sys$help:HELPLIB.HLB DISK1:[DIR.GHOSTSCRIPT.DOC]GS-VMS.HLP
$ define gs_exe DISK1:[DIR.GHOSTSCRIPT.BIN] $ define gs_lib DISK1:[DIR.GHOSTSCRIPT.EXE] $ gs :== $gs_exe:gs.exe
If you have DECWindows/Motif installed, you may wish to replace the FONTMAP.GS file with FONTMAP.VMS . Read the comment at the beginning of the latter file for more information.
Copyright © 2000-2021 Artifex Software, Inc. All rights reserved.
This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of that license. Refer to licensing information at https://www.artifex.com or contact Artifex Software, Inc., 1305 Grant Avenue — Suite 200, Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
Ghostscript version 9.54.0, 30 March 2021
© Copyright 2019-2021 Artifex Software, Inc.
All rights reserved.Membership available
Catch up on the latest technical insights and tools from the PyTorch community.
PyTorch 2.1
We are excited to announce the release of PyTorch 2.1!
PyTorch Edge
Build innovative, privacy-aware experiences with superior productivity, portability, and performance.
Key Features &
CapabilitiesProduction Ready
Transition seamlessly between eager and graph modes with TorchScript, and accelerate the path to production with TorchServe.
Distributed Training
Scalable distributed training and performance optimization in research and production is enabled by the torch.distributed backend.
Robust Ecosystem
A rich ecosystem of tools and libraries extends PyTorch and supports development in computer vision, NLP and more.
Cloud Support
PyTorch is well supported on major cloud platforms, providing frictionless development and easy scaling.
Install PyTorch
Select your preferences and run the install command. Stable represents the most currently tested and supported version of PyTorch. This should be suitable for many users. Preview is available if you want the latest, not fully tested and supported, builds that are generated nightly. Please ensure that you have met the prerequisites below (e.g., numpy), depending on your package manager. Anaconda is our recommended package manager since it installs all dependencies. You can also install previous versions of PyTorch. Note that LibTorch is only available for C++.
PyTorch Build
Compute Platform
Run this Command:
PyTorch Build
Stable (1.13.0)
Preview (Nightly)
Compute Platform
Run this Command:
conda install pytorch torchvision -c pytorchNOTE: PyTorch LTS has been deprecated. For more information, see this blog.
Quick Start With
Cloud PartnersGet up and running with PyTorch quickly through popular cloud platforms and machine learning services.
Amazon Web Services
- PyTorch on AWS
- Amazon SageMaker
- AWS Deep Learning Containers
- AWS Deep Learning AMIs
Установить OR-Tools
Оптимизируйте свои подборки Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Google создал OR-Tools на C++, но вы также можете использовать его с Python, Java или C# (на платформе .NET).
Установите OR-Tools для Python
Самый быстрый способ получить OR-Tools — установить бинарную версию Python. Если у вас уже есть Python (версия 3.8+ для Linux, macOS или Windows) и менеджер пакетов Python PIP , вы можете установить OR-Tools следующим образом:
python -m pip install --upgrade --user ortoolsЧтобы установить OR-Tools для другого языка или из исходного кода, см. следующий раздел.
Инструкции по установке для всех поддерживаемых языков
Для получения инструкций по установке OR-Tools, а также необходимых предварительных условий щелкните одну из следующих ссылок:
- OR-инструменты для C++
- OR-Инструменты для .Net
- OR-инструменты для Java
- OR-инструменты для Python
Скачать OR-Tools
Если вы уже знакомы с установкой OR-Tools и просто хотите скачать последнюю версию, вы можете получить ее либо из бинарного дистрибутива , либо из исходного файла .
Примечание. Если вы планируете использовать сторонний решатель с OR-Tools, вам необходимо установить OR-Tools из исходных файлов.
Если вам нужно установить более старую версию, на странице выпуска OR-Tools есть ссылки на загрузки предыдущих выпусков.
Бинарные распределения
Здесь приведены ссылки на бинарные дистрибутивы OR-Tools по языкам и платформам.
Питон
Самый простой способ установить OR-Tools для Python — из командной строки, как показано выше .
Однако при желании вы можете установить OR-Tools из одного из файлов колеса Python.
С++
Предварительно созданные архивы C++ OR-Tools.
Линукс
macOS
Окна
