alexfrom0815 / Online-3D-BPP-DRL

This repository contains the implementation of paper Online 3D Bin Packing with Constrained Deep Reinforcement Learning.
305 stars 73 forks source link

How to run the code with a2c #22

Closed SylvanHuang closed 12 months ago

SylvanHuang commented 1 year ago

Since choosing the default acktr algorithm results in “RuntimeError: symeig_cuda: the algorithm failed to converge”, I chose to run the a2c algorithm, but it still stops with an error. The command to run a2c that I used is "python main.py --mode train --use-cuda --item-seq rs --algorithm a2c --lr 1e-6 --eps 1e-5 --alpha 0.99", and the error message is as follows: File "main.py", line 183, in train_model value_loss, action_loss, dist_entropy, prob_loss, graph_loss = agent.update(rollouts) File "/mnt/Online-3D-BPP-DRL-main/acktr/algo/acktr_pipeline.py", line 59, in update mask_len = self.args.container_size[0]*self.args.container_size[1] AttributeError: 'NoneType' object has no attribute 'container_size'

By the way, before I ran into the above problem, I had changed “parser.add_argument( '--learning_rate' ...)” to “parser.add_argument( '--lr' )” in the arguments.py, thus avoiding the problem of learning_rate being inaccessible.

suoyike1 commented 4 months ago

Did you solve this problem? Maybe I need your help.

suoyike1 commented 4 months ago

When I use a2c to train the model, a mistake happens as follow Traceback (most recent call last): File "main.py", line 233, in main(args) File "main.py", line 24, in main train_model(args) File "main.py", line 99, in train_model args.lr, AttributeError: 'Namespace' object has no attribute 'lr'