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

use-transfer path error #3

Closed
impulsecorp opened this issue May 1, 2019 · 2 comments
Closed

use-transfer path error #3

impulsecorp opened this issue May 1, 2019 · 2 comments

Comments

@impulsecorp
Copy link

The supervised pre-training part works fine on my Ubuntu 16.04 server at
/home/ubuntu/newrl/DeepRL/
python3 pretrain/run_experiment.py --gym-env=MsPacmanNoFrameskip-v4 --cpu-only --classify-demo --use-mnih-2015 --train-max-steps=10000 --batch-size=32 --grad-norm-clip=0.5 --demo-ids=1,2,3,4,5,6,7,8

but when I then try to use the pre-trained network in A3C-TB like:
/home/ubuntu/newrl/DeepRL/
python3 a3c/run_experiment.py --gym-env=MsPacmanNoFrameskip-v4 --parallel-size=1 --max-time-step-fraction=1.0 --initial-learn-rate=0.0007 --rmsp-epsilon=1e-5 --grad-norm-clip=0.5 --use-mnih-2015 --unclipped-reward --transformed-bellman --use-transfer --append-experiment-num=1

it gives this error:

Traceback (most recent call last):
File "a3c/run_experiment.py", line 159, in
main()
File "a3c/run_experiment.py", line 155, in main
run_a3c(args)
File "/home/ubuntu/newrl/DeepRL/a3c/a3c.py", line 410, in run_a3c
var_list=transfer_var_list,
File "/home/ubuntu/newrl/DeepRL/a3c/game_ac_network.py", line 245, in load_transfer_model
assert folder.is_dir()
AssertionError

I know the "--use-transfer" is supposed to automatically find the pretrained model, but since that did not work I also tried adding a path for it at the end of the command like this but it gave the same error::
python3 a3c/run_experiment.py --gym-env=MsPacmanNoFrameskip-v4 --parallel-size=1 --max-time-step-fraction=1.0 --initial-learn-rate=0.0007 --rmsp-epsilon=1e-5 --grad-norm-clip=0.5 --use-mnih-2015 --unclipped-reward --transformed-bellman --use-transfer --append-experiment-num=1 --pretrained-model-folder='/home/ubuntu/newrl/DeepRL/results/pretrain_models/MsPacmanNoFrameskip_v4_mnih2015_l2beta1E-04_clipnorm5E-01/transfer_model/'

@gabrieledcjr
Copy link
Owner

when using --use-transfer, it automatically finds the pretrained model for a very specific pretrained model. Also, it might be confusing, but you should use --transfer-folder instead of --pre-trained-model-folder. The pretrained-model-folder is used for something else.

So use --transfer-folder and I suggest specifying the path as you did. In the path, don't include /transfer_model folder as it is automatically appended. And you don't need the single quotes. So in your case, it should be

python3 a3c/run_experiment.py --gym-env=MsPacmanNoFrameskip-v4 --parallel-size=1 --max-time-step-fraction=1.0 --initial-learn-rate=0.0007 --rmsp-epsilon=1e-5 --grad-norm-clip=0.5 --use-mnih-2015 --unclipped-reward --transformed-bellman --use-transfer --append-experiment-num=1 --transfer-folder=/home/ubuntu/newrl/DeepRL/results/pretrain_models/MsPacmanNoFrameskip_v4_mnih2015_l2beta1E-04_clipnorm5E-01

@impulsecorp
Copy link
Author

Yes, that worked, thanks.

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

1 participant