Baseline installation

#1

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?

#2

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

#3

Hi @mlerik

Thanks for the reply.

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

#4

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

#5

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?

#6

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)

#7

Last thing:

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

#8

Hi @xzhaoma

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

Best regards,
Erik

#9

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

#11

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.

#12

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?

#13

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

#14

Hi mlerik,

My pleasure to help.

I’m doing single agent training.

#15

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