/pix2pix-tensorflow-spell

Experimentation with pix2pix running on spell

Primary LanguagePython

pix2pix-tensorflow-spell

Experimentation with pix2pix running on spell

Upload training data on spell ressources
spell upload sticks

Training pix2pix with the data
spell run --machine-type V100 --framework tensorflow "python pix2pix.py --mode train --input_dir sticks --output_dir ckpt --which_direction AtoB --max_epochs 200 --ngf 32 --ndf 32" -m uploads/sticks
--ngf 32 --ndf 32 seems to work faster

Export the model
spell run --machine-type V100 --framework tensorflow "python pix2pix.py --mode export --output_dir export/ --checkpoint ckpt --which_direction AtoB" -m runs/RUN_ID/ckpt
We probably don't need GPU to do that.


Download the model
spell cp runs/RUN_ID/export

Convert model to tensorflow.js/ml5js bin
'''with python3.7'''

Convert the optimized model to tensorflow.js
python export-checkpoint.py --checkpoint ./export --output_file static/models/yourModelName.pict

if issue with tensorflow : pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl

python export-checkpoint.py --checkpoint ckpt --output_file model_AtoB.bin