Skip to content
/ PaT Public

Online 2D Bin Packing Problem Based on Deep Reinforcement Learning with Transformer and PPO

License

Notifications You must be signed in to change notification settings

JeepWay/PaT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mask-Pack

Environment

  • OS: Ubuntu 20.04.1
  • Python: 3.9.15
  • PyTorch: 2.4.1+cu118
  • stable-baselines3: 2.3.2

Note: the training results might be defferent with different hearware environment and OS, under the same .yaml setting file.

Installation

# only cpu
bash scripts/install.sh -c 0

# use cuda (version: 11.8)
bash scripts/install.sh -c 11.8

Usage example

python main.py --config_path settings/main/v1_PPO-h200-c02-n64-b32-R15-k1-rA.yaml

Using docker images

Build docker image

Build CPU image:

make docker-cpu

Build GPU image (with nvidia-docker):

make docker-gpu

Run the images (CPU/GPU)

Run the nvidia-container-toolkit GPU image

docker run -it --rm --gpus=all --volume $(pwd):/home/user/maskpack jeepway/maskpack-gpu:latest bash -c "cd /home/user/maskpack && ls && pwd && /bin/bash"

Or, use make command to run with the shell file

make docker-run-gpu

Run the docker CPU image

docker run -it --rm --volume $(pwd):/home/user/maskpack jeepway/maskpack-cpu:latest bash -c "cd /home/user/maskpack && ls && pwd && /bin/bash"

Or, use make command to run with the shell file

make docker-run-cpu

After running the above command, you will enter the terminal of the docker image.

Run .yaml setting file

Run the .yaml setting in the setting folder, for example:

python main.py --config_path settings/main/v1_PPO-h200-c02-n64-b32-R15-k1-rA.yaml

After running the above command, you will be asked to choose the visualization mode like below.

wandb: (1) Create a W&B account
wandb: (2) Use an existing W&B account
wandb: (3) Don't visualize my results
wandb: Enter your choice: 

If you want to visualize the training results on the wandb website, you can choose the second option, and then you will be asked to paste the API key of your wandb account.

If you don't have one, you can choose the first option to create a new account.

If you just want to save the training results locally, you can choose the third option.

Compared algorithms

you can watch the source code of the compared algorithms in this repository

  1. Zhao-2D (transform from 3D to 2D of the original paper)
  2. Deep-Pack
  3. Deep-Pack-with-mask
    • Based on Deep-Pack, we add the action mask to the original algorithm to reduce the selection of invalid actions, for the purpose of fair comparison with Mask-Pack.

Reference

About

Online 2D Bin Packing Problem Based on Deep Reinforcement Learning with Transformer and PPO

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages