Skip to content

Instantly share code, notes, and snippets.

@harrywang
Last active June 10, 2020 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harrywang/b6a32d486d92fa47be917008c5cd3b68 to your computer and use it in GitHub Desktop.
Save harrywang/b6a32d486d92fa47be917008c5cd3b68 to your computer and use it in GitHub Desktop.
tai-config

Setup

Use V3 from Tai: Screen Shot 2020-06-10 at 9 58 22 AM

python -m venv venv
source venv/bin/activate
pip install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple/

Verify GPU

Make sure your tf is using GPU:

# python
Python 3.8.3 (default, May 19 2020, 18:47:26)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'2.2.0'
>>> print(len(tf.config.list_physical_devices('GPU')))
...
[2]

Change pypi source

It's extremely slow to use default pypi mirror - need to change to the mirror from Tsinghua.

source venv/bin/activate
mkdir ~/.pip
cd ~/.pip
touch pip.conf
vim pip.conf

put the following to the pip.conf, save and quit vim:

[global]

index-url = https://pypi.tuna.tsinghua.edu.cn/simple

then, test out the pypi source has changed by using --verbose and you can see Looking in indexes using the new source from Tsinghua:

pip install --verbose scikit-learn
Created temporary directory: /tmp/pip-ephem-wheel-cache-f0xb37qz
Created temporary directory: /tmp/pip-req-tracker-jfcbjoto
Created requirements tracker '/tmp/pip-req-tracker-jfcbjoto'
Created temporary directory: /tmp/pip-install-r_y341o4
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple

Run

Data has to be uploaded to the /data/User/v3 folder, then run python /data/User/v3/gpu-speed-test-tf2.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment