This work is currently under review.
Ensure PYTHONPATH
env variable is set first.
export PYTHONPATH="/insert/path/of/image-tsp"
All data generation code can be found in src/main/generate_data.py
. The command line script to run would be python src/main/generate_data.py generate
. Generating the data first entails generating the pickle files. the draw
and drawall
commands can then be used to draw the TSP images based on the pickle files. It is necessary to draw the pickle files as the training process will be simpler. Reading an image in from disk is easier than generating it every time is needed (probably faster too).
On MIT Supercloud, the file generate.sh
has to be edited. and then sbatch generate.sh
should be run. The function signature inside generate.sh
should also be helpful in understanding how to run this.
After generating the pickle files, run
python src/main/generate_data.py draw TSP400.pickle 400 "(1024, 1024, 3)"
to draw the TSP images.
To train a model:
run.sh
that represents the number of cities you would like to train on../run.sh
- Configured for MIT Supercloud.To look deeper in the code, see src/nn/tspconv.py
.
To run the test samples on the model:
LLsub -i -g volta:1
to acquire a GPU node. Only for MIT Supercloud.python src/nn/tspconv_eval.py
Don't forget to configure the experiment folders inside tspconv_eval.py
. If it doesn't run, check your PYTHONPATH
.