Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run the code with a2c #22

Closed
SylvanHuang opened this issue Nov 25, 2023 · 2 comments
Closed

How to run the code with a2c #22

SylvanHuang opened this issue Nov 25, 2023 · 2 comments

Comments

@SylvanHuang
Copy link

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
Copy link

suoyike1 commented Jul 8, 2024

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

@suoyike1
Copy link

suoyike1 commented Jul 8, 2024

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants