Setting up the Python Environment
Conda allows us to set up a defined environment with specific versions of the python version as well as
of the packages.
conda create -n jh_class python=3.10
Then activate this environment before installing packages!
conda activate jh_class
Install specific packages:
conda install -c conda-forge tensorflow=2.15.0 -y
conda install -c conda-forge pandas=2.2.0 -y
conda install -c conda-forge scikit-learn=1.4.1 -y
conda install -c conda-forge matplotlib=3.8.3 -y
conda install -c conda-forge ipython=8.21.0 -y
conda install -c conda-forge transformers=4.37.2 -y
conda install -c conda-forge jupyter=1.0.0 -y
conda install -c conda-forge sentencepiece=0.1.99 -y
conda install -c conda-forge click=8.0.4 -y
This command lists the package versions that are installed in the currently active environment:
conda list
Result:
Computer without GPU
Computer with GPU
Install packages (without version number):
conda install -c conda-forge imageio -y
conda install -c conda-forge keras-preprocessing -y
conda install -c conda-forge pydot -y
Installing YOLO
https://github.com/ultralytics/yolov5
mkdir not_on_github
cd not_on_github
git clone https://github.com/ultralytics/yolov5
cd yolov5
pip install -r requirements.txt
pip install ninja
This will also install PyTorch which will be used in later examples.
Installing StyleGAN
The class module of class 07_2 uses stylegan2, however the environment did not work with the RTX 3090
card.
Instead, I am using the stylegan3 examples from
https://github.com/NVlabs/stylegan3
mkdir not_on_github
cd not_on_github
git clone https://github.com/NVlabs/stylegan3.git
cd stylegan3
conda env create -f environment.yml
conda install ipython
Installing tabgan
Adding tabgan to jh_class will corrupt the jh_class environment such that the class programs
will not run any longer,
It is better to create a separate conda environment for the tabgan module 7.5.
Other
The syntax for version numbers in pip is
pip install tensorflow==2.15.0
but we don't want to install anything outside of conda,
so that we know that we are using the intended versions of our packages.