#!/usr/bin/env python3
import tensorflow as tf
import numpy as np
- Download the CUDA toolkit i.e.
runfile(local)
from Nvidia. - Download the cuDNN
.tgz
file from Nvidia. You can use this hack from Nvidia Developer Forum towget
a cuDNN file. - Install CUDA toolkit (includes cuBLAS).
export CUDA_ROOT=/where/to/install/cuda
bash cuda_<version>.run --silent \
--toolkit --toolkitpath=$CUDA_ROOT \
--samples --samplespath=$CUDA_ROOT/samples
--tmpdir=$HOME/tmp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tensor names, shape and dtype of each shard | |
python -m tensorflow.python.tools.inspect_checkpoint --file_name path/variables/variables | |
# Tensor names, shape and dtype | |
python -m tensorflow.python.tools.inspect_checkpoint --file_name path/variables/variables --all_tensor_names | |
# Tensor names, shapes, dtype and value | |
python -m tensorflow.python.tools.inspect_checkpoint --file_name path/variables/variables --all_tensors |
The .npz
file format is used to save several numpy arrays into a single zipped file.
Documentation.
import numpy as np
a = np.array([42])
b = np.array([2, 3, 5, 7, 9])
with open("foo.npz", "wb") as f:
saved_model_cli show --dir resnet/1
saved_model_cli show --dir resnet/1 --tag_set serve
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# python train.py -train_steps 1 -data data/demo -gpu_ranks 0 | |
import subprocess | |
from itertools import product | |
src_emb = [128, 1024] | |
dst_emb = [128, 1024] | |
hidden = [128, 1024] |
A simple example of how to use PyTorch ATen directly using C++.
ps2epsi foo.ps
#ps2pdf14 -dEPSCrop -dAutoRotatePages=/None -dPDFSETTINGS=/prepress -dEmbedAllFonts=true foo.epsi foo.pdf
ps2pdf14 -dEPSCrop -dAutoRotatePages=/All -dPDFSETTINGS=/prepress -dEmbedAllFonts=true foo.epsi foo.pdf
DEB files are ar
archives, which contain three files:
- debian-binary
- control.tar.gz
- data.tar.gz
Unpacking this file is a two step process.
ar vx mypackage.deb
tar -xzvf data.tar.gz