To use TFPWA, we need some dependent packages. There are two main ways, conda and virtualenv you can choose one of them. Or you can choose other method in :ref:`other-method`
To avoid conflict of dependence, we recommed to use vitrual environment. there are two main vitrual environment for python packages, conda and virtualenv. You can choose one of them. Since conda include cudatoolkit for gpu, we recommed it for user.
- 1.1.1 Get miniconda for python3 from miniconda3 and install it.
- 1.1.2 Create a virtual environment by
conda create -n tfpwa
, the -n <name> option will create a environment named by <name>. You can also use -p <path> option to create environment in the <path> directory.
- 1.1.3 You can activate the environment by
conda activate tfpwa
and then you can install packages in the conda environment
- 1.1.4 You can exit the environment by
conda deactivate
- 1.2.1 You should have a python3 first.
- 1.2.2 Install virtualenv
python3 -m pip install --user virtualenv
- 1.2.3 Create a virtual environment
python3 -m virtualenv ./tfpwa
, it will store in the path tfpwa
- 1.2.4 You can activate the environment by
source ./tfpwa/bin/activete
- 1.2.5 You can exit the environment by
deactivate
The most important package is tensorflow2. We recommed to install tensorflow first. You can following the install instructions in tensorflow website (or tensorflow.org).
Here we provide the simple way to install tensorflow2 gpu version in conda environment
conda install tensorflow-gpu=2.4
it will also install cudatoolkit.
When using virtualenv, there is also simple way to install tensorflow2
python -m pip install tensorflow
, but you should check you CUDA installation for GPU.
Note
You can use -i https://pypi.tuna.tsinghua.edu.cn/simple option to use pypi mirror site.
Other dependences of TFPWA is simple.
Get the packages using
git clone https://github.com/jiangyi15/tf-pwa
3.2.1 other dependences
In conda environment, go into the directory of tf-pwa, you can install the rest dependences by
conda install --file requirements-min.txt
Note
we recommed Ampere card users to install with tensorflow_2_6_requirements.txt (see this technical FAQ).
conda install --file tensorflow_2_6_requirements.txt -c conda-forge
3.2.2 TFPWA
install TFPWA
python -m pip install -e ./ --no-deps
Use --no-deps to make sure that no PyPI package will be installed. Using -e, so it can be updated by git pull directly.
In virtualenv, You can install dependences and TFPWA together.
python3 -m pip install -e ./
Using -e, so it can be updated by git pull directly.
There are some option packages, such as uproot for reading root file.
It can be installed as
conda install uproot -c conda-forge
It can be installed as
python -m pip install uproot
We also provided other install method.
A pre-built conda package (Linux only) is also provided, just run following command to install it.
conda config --add channels jiangyi15 conda install tf-pwa
When using pip, you will need to install CUDA to use GPU. Just run the following command :
python3 -m pip install -e .
To contribute to the project, please also install additional developer tools with:
python3 -m pip install -e .[dev]