- Use
python2
notpython3
- Suppose the current working directory is
$CWD
- Suppose the data path is
$DATA_PATH
- Suppose the current shell is
bash
- Download following
requirements.txt
to current working directory - Old version of
cuda
installed(tested onv8.0.44
) - Old version of
cudnn
installed(tested on7.0v4.0
)
- Install dependencies
pip2 install -qr requirements.txt
- Clone
pylearn2
repo to current working directorygit clone git://github.com/lisa-lab/pylearn2.git $CWD/pylearn2
- Change directory
cd $CWD/pylearn2
- Install
pylearn2
python2 setup.py develop
- Run following code to see if
pylearn2
is installed correctlypython2 -c "import pylearn2"
- Set your data path here
echo export PYLEARN2_DATA_PATH=$DATA_PATH >> ~/.bashrc
- Reload
bash
profilesource ~/.bashrc
- Download possible dataset, using
mnist
here for examplepython2 $CWD/pylearn2/pylearn2/scripts/datasets/download_mnist.py
- Clone
GAN
repo to current working directorygit clone [email protected]:goodfeli/adversarial.git $CWD/adversarial
- Export
adversarial
directory to$PYTHONPATH
system variable,echo export PYTHONPATH=$PYTHONPATH:$CWD/adversarial >> ~/.bashrc
- Reload
bash
profilesource ~/.bashrc
- Check if the system variable
$PYTHONPATH
is set correctlypython2 -c "import adversarial"
- Train model and the model should be saved in
$CWD/adversarial/mnist.pkl
THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python2 -m pylearn2.scripts.train $CWD/adversarial/mnist.yaml
- Test model
THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python2 -m adversarial.parzen_ll -p $CWD/adversarial/mnist.pkl -d mnist -v -s 0.01