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

No such file or directory, confusing concatenation? #6

Open
JadenTravnik opened this issue Jul 11, 2018 · 3 comments
Open

No such file or directory, confusing concatenation? #6

JadenTravnik opened this issue Jul 11, 2018 · 3 comments

Comments

@JadenTravnik
Copy link

(I'm using a conda environment on windows) When trying to run from the root directory:

python arnold.py --exp_name test --main_dump_path dumped --scenario defend_the_center --frame_skip 2 --action_combinations "turn_lr+attack" --reload pretrained/defend_the_center.pth --evaluate 1 --visualize 1 --gpu_id 0

I get the error No such file or directory: 'dumped\\test\\<testid>\\pretrained/defend_the_center.pth'.
Looking into this I saw that the paths are concatenated.

Shouldn't the weights be loaded from the pretrained directory instead?
Eg:
model_path = params.reload

What is the expected functionality?

@glample
Copy link
Owner

glample commented Jul 12, 2018

Mmm I never tried on Windows. In the run.sh script there is $PWD at the beginning of the model location, but this may not work on Windows as it works on Linux. Can you try to give the full path to the reload argument?

@JadenTravnik
Copy link
Author

JadenTravnik commented Jul 12, 2018

Giving either the full path or the relative pretrained/defend_the_center.pth works fine after this change:

model_path = params.reload #os.path.join(params.dump_path, params.reload)

because the model is stored in <path_to_root>/pretrained/defend_the_center.pth in the root directory not <path_to_root>/dumped/test/<testid>/pretrained/defend_the_center.pth.

I was successfully able to train and test after this change so the os.path.join is unnecessary.

Rather, the --reload parameter should be the relative path to the weights (.pth) one wants to reload, independent of the --dumped directory. This would allow one to run experiments using the pretrained weights from a different experiment.

Eg:

python arnold.py --exp_name experiment_B --dump_path dumped --scenario defend_the_center --frame_skip 2 --action_combinations "turn_lr+attack" --reload dumped/experiment_A/ngeuokc6ja/best-630000.pth --gpu_id 0

Also, great repo 🥇!

@Throne-myworld
Copy link

I'm eager to run this programm on windows, but the requirements are so complex , could you show your enviroments and some utilities?

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

3 participants