Baseline installation

Hi,

I downloaded the baseline repo and trying to install the packages by:

python setup.py install

However, errors given as:

Download error on git+https://gitlab.aicrowd.com/flatland/flatland.git@42-run-baselines-in-ci: unknown url type: git+https -- Some packages may not be found! No local packages or working download links found for torch>=1.1.0

How are we suppose to install pytorch?

Hi @xzhaoma

The baseline Repo does not need to be installed. Once you have installed Fltaland-RL by following the quick start instructions you can just clone the baseline repo to a desired location and run the code from that folder.

Hope this helps and have fun with the challenge :steam_locomotive::railway_car::railway_car::railway_car::railway_car::railway_car::grinning:

Best regards,
Erik

Hi @mlerik

Thanks for the reply.

I think the quick start instructions are missing the part of installing pytorch, as you replied here:

Hi @xzhaoma

Thank you for your reply. I updated the training introduction. Will also see if we can simplify this further by automatically installing the dependencies.

Hope this clarifies it.

Best regards,
Erik

Hi @mlerik,

Two more issue identified:

After installing the pytorch, running the script will cause an error:

File "<folderStruct>\baselines\torch_training\dueling_double_dqn.py", line 11, in <module> from torch_training.model import QNetwork, QNetwork2 ModuleNotFoundError: No module named 'torch_training'

This can be fixed by removing the torch_training prefix in the line from torch_training.model import QNetwork, QNetwork2 as the file locates inside the “torch_training” folder already.

Similar issues exist for the line from utils.observation_utils import norm_obs_clip, split_tree in training_navigation.py file, as utils folder exist outside the parent folder.

Is this caused by a change in the folder structure, or am I doing sth wrong?

Solved.

This is due to the root path of baseline is not added into the PYTHONPATH.
Fixed by:

import os
root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(root_path)

Last thing:

renderEnv seems now changed into render_env.
The code in baseline is not modified accordingly.

Hi @xzhaoma

Thanks for brining this to my attention and the proposed solution.
Will update the rendering to the new version.

Best regards,
Erik

Thanks all for the inputs.
Just wanted to add that, the baseline repository can evolve much faster with community contributions.
Please feel free to send in pull requests with changes that worked for you.

Cheers,
Mohanty

Will do.

Actually, I just identify another bug that no matter CUDA is available or not, the baseline will always display “cpu”. submitted a PR already.

Sorry for keep posting things here.

After training the baseline, I got two window as mentioned in the starting guide, one for the cost function curve, one for an animated image of results.

However, my second one is still image and not animated.
Any sugggestions?

Hi @xzhaoma

Are you doing the single agent training or the multi agent training? Thanks alot for your PR. It’s merged into master now

Hi mlerik,

My pleasure to help.

I’m doing single agent training.

To view the performance of your agents. I suggest you use multi_agent_inference.py for your multi agent example (just load the correct network file from training) or uste render_agent_behavior.py for single agent behavior. If this does not work, don’t hesitate to reach out. We are here to help.

best regards,
Erik