Home

Awesome

<img src="images/packit.gif" align="right" width="30%"/>

PackIt: A Virtual Environment for Geometric Planning
Ankit Goyal, Jia Deng
International Conference on Machine Learning (ICML), 2020

Getting Started

First clone the repository. We would refer to the directory containing the code as <packit_dir>.

git clone git@github.com:princeton-vl/PackIt.git

Requirements

The PackIt environment is build using Unity ML-agents version 0.4.0. To train the neural network model, we recommend using a machine with GPU. The code is tested on Linux OS with Python version 3.5, CUDA version 8.0, and cuDNN version 5.1. We provide standlone Unity builds for Linux x86_64 platform. For visualization, we also provide a Unity build for Mac OS.

Install Libraries

We recommend to first install Anaconda and create a virtual environment.

conda create --name packit python=3.5

Activate the virtual environment and install the libraries. Make sure you are in <packit_dir>.

conda activate packit
pip install -r requirements.txt

Download Datasets and Pre-trained Models

Make sure you are in <packit_dir>. download.sh script downloads all the data, unzips them, and places them at correct locations. Note that symbolic links are created between the data folder and appropriate locations inside the unity data directory. This is necessary so that the data is accessible from the build unity game.

chmod +x download.sh
./download.sh

Code Organization

Testing

To debug whether everything is set up correctly, use the test_packing_env.ipynb jupyter notebook. It runs a packing environment with ground-truth actions. Make sure you have downloaded everything properly before this step. Note that the plotting of voxels in matplotlib is slow.

Running Experiments

To run any experiment, refer to the command dictionary inside commands.py. For example to run heuristic-based baseline same as row 1 in table 1 of the paper use the command python main_heuristic.py --eval_va_or_te 0 --pol_1 sha_rand. For some experiments, like tab_3_row_2_3, the dictionary contains a list of commands. Essentially, we break the evaluation into multiple commands so that they can be run in parallel. Depending on the computing infrastructure, these commands can be run in parallel or serial.

Visualization

Make sure you have downloded everything before this step. Follow the steps below:

  1. Save the actions. Follow the python script <packit_dir>/visualize.py. It saves the agents actions in a json file. We also provide some prerecorded actions in <packit_dir>/data/visualize
  2. Run the unity visulization build like this ./<packit_dir>/unity/evns/packit_viz.x86_64 -getSavedAct true -fileName pack_va/0_va -packID 1 -actFileName visualize/pack_va_0_va_1_gt. This would run visualization for the pack inside pack_va/0_va with ID 1 using the groundtruth actions. When the unity build opens up, press a to execute the actions. Only for visualization, we also provide a Mac OS unity build which could be used for visualization on Mac OS. The Mac OS visualizer could be run as ./<packit_dir>/unity/evns/packit_viz_mac.app/Contents/MacOS/EgpGame3 -getSavedAct true -fileName pack_va/0_va -packID 1 -actFileName visualize/pack_va_0_va_1_gt.

Notes

ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_card_driver returned error: Permission denied
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_concat returned error: Permission denied
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: Permission denied
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: Permission denied
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM default

Acknowledgment

This repository uses code from ML-Agents and stable-baselines.

If you find our research useful, consider citing it:

@inproceedings{goyal2020packit,
  title={PackIt: A Virtual Environment for Geometric Planning},
  author={Goyal, Ankit and Deng, Jia},
  booktitle={International Conference on Machine Learning},
  year={2020},
}