Code Monkey home page Code Monkey logo

rl_collision_avoidance's Introduction

This is the training code for:

Journal Version: M. Everett, Y. Chen, and J. P. How, "Collision Avoidance in Pedestrian-Rich Environments with Deep Reinforcement Learning", in review, Link to Paper

Conference Version: M. Everett, Y. Chen, and J. P. How, "Motion Planning Among Dynamic, Decision-Making Agents with Deep Reinforcement Learning", IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2018. Link to Paper, Link to Video

The gym environment code is included as a submodule.

Install

Grab the code from github, initialize submodules, install dependencies and src code

# Clone either through SSH or HTTPS (MIT-ACL users should use GitLab origin)
git clone --recursive [email protected]:mit-acl/rl_collision_avoidance.git

cd rl_collision_avoidance
./install.sh

There are some moderately large (10s of MB) checkpoint files containing network weights that are stored in this repo as Git LFS files. They should automatically be downloaded during the install script.

Train RL (starting with a network initialized through supervised learning on CADRL decisions)

To start a GA3C training run (it should get approx -0.05-0.05 rolling reward to start):

./train.sh TrainPhase1

To load that checkpoint and continue phase 2 of training, update the LOAD_FROM_WANDB_RUN_ID path in Config.py and do:

./train.sh TrainPhase2

By default, the RL checkpoints will be stored in RL_tmp and I think files will get overwritten if you train multiple runs. Instead, I like using wandb as a way of recording experiments/saving network parameters. To enable this, set the self.USE_WANDB flag to be True in Config.py, then checkpoints will be stored in RL/wandb/run-<datetime>-<id>.

To run experiments on AWS

Start a bunch (e.g., 5) of AWS instances -- I used c5.2xlarge because they have 8vCPUs and 16GB RAM (somewhat like my desktop?). Note: this is just an example, won't work out of box for you (has hard-coded paths)

Add the IP addresses into ga3c_cadrl_aws.sh.

./ga3c_cadrl_aws.sh panes
# C-a :setw synchronize-panes -- will let you enter the same command in each instance

Then you can follow the install & train instructions just like normal. When training, it will prompt you for a wandb login (can paste in the authorization code from app.wandb.ai/authorize).

Observed Issues

If on OSX, when running the ./train.sh script, you see:

objc[39391]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[39391]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.

just add this ENV_VAR: export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES.

If you find this code useful, please consider citing:

@inproceedings{Everett18_IROS,
  address = {Madrid, Spain},
  author = {Everett, Michael and Chen, Yu Fan and How, Jonathan P.},
  booktitle = {IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
  date-modified = {2018-10-03 06:18:08 -0400},
  month = sep,
  title = {Motion Planning Among Dynamic, Decision-Making Agents with Deep Reinforcement Learning},
  year = {2018},
  url = {https://arxiv.org/pdf/1805.01956.pdf},
  bdsk-url-1 = {https://arxiv.org/pdf/1805.01956.pdf}
}

rl_collision_avoidance's People

Contributors

mfe7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rl_collision_avoidance's Issues

collision_avoidance_env.py line 356

rl_collision_avoidance/gym-collision-avoidance/gym_collision_avoidance/envs/collision_avoidance_env.py line 356

1656837465812

I suppose it should be rewards[i] = -0.1 + dist_btwn_nearest_agent[i]/2.

SA-CADRL

Hi,

I am also interested in your work SA-CADRL (Socially Aware Motion Planning with Deep Reinforcement Learning). But I could not find this policy (SA-CADRL) under "gym-collision-avoidance/gym_collision_avoidance/envs/policies"

Could you please offer me some code to learn?

Thanks a lot~

./train.sh TrainPhase1. tensorflow.python.framework.errors_impl.DataLossError: not an sstable (bad magic number)

When I run ./train.sh TrainPhase1, I get this ....

`--------------------------------------------------------------------------------------------------------------
Running GA3C-CADRL gym-collision-avoidance training script (TrainPhase1)

[Server] Making model...
[Server] Loading Regression Model then training RL.
[NetworkVPCore] Loading checkpoint file: /home/rl_collision_avoidance/ga3c/GA3C/checkpoints/regression/wandb/run-rnn/checkpoints/network_00000000
Traceback (most recent call last):
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call
return fn(*args)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn
target_list, run_metadata)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.DataLossError: not an sstable (bad magic number)
[[{{node save/RestoreV2}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "Run.py", line 74, in
Server().main()
File "/home/rl_collision_avoidance/ga3c/GA3C/Server.py", line 66, in init
self.model.load(learning_method='regression')
File "/home/rl_collision_avoidance/ga3c/GA3C/NetworkVPCore.py", line 246, in load
self.saver.restore(self.sess, filename)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/training/saver.py", line 1290, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 956, in run
run_metadata_ptr)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1180, in _run
feed_dict_tensor, options, run_metadata)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1359, in _do_run
run_metadata)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1384, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.DataLossError: not an sstable (bad magic number)
[[node save/RestoreV2 (defined at /home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py:1748) ]]

Original stack trace for 'save/RestoreV2':
File "Run.py", line 74, in
Server().main()
File "/home/rl_collision_avoidance/ga3c/GA3C/Server.py", line 57, in init
self.model = self.make_model()
File "/home/rl_collision_avoidance/ga3c/GA3C/Server.py", line 83, in make_model
return globals()[Config.NET_ARCH](Config.DEVICE, Config.NETWORK_NAME, self.num_actions) # TODO can probably change Config.NETWORK_NAME to Config.NET_ARCH
File "/home/rl_collision_avoidance/ga3c/GA3C/NetworkVP_rnn.py", line 37, in init
super(self.class, self).init(device, model_name, num_actions)
File "/home/rl_collision_avoidance/ga3c/GA3C/NetworkVPCore.py", line 57, in init
self.saver = tf.compat.v1.train.Saver({var.name: var for var in vars}, max_to_keep=0)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/training/saver.py", line 828, in init
self.build()
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/training/saver.py", line 840, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/training/saver.py", line 878, in _build
build_restore=build_restore)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/training/saver.py", line 508, in _build_internal
restore_sequentially, reshape)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/training/saver.py", line 328, in _AddRestoreOps
restore_sequentially)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/training/saver.py", line 575, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/ops/gen_io_ops.py", line 1696, in restore_v2
name=name)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/framework/op_def_library.py", line 794, in _apply_op_helper
op_def=op_def)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 3357, in create_op
attrs, op_def, compute_device)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 3426, in _create_op_internal
op_def=op_def)
File "/home/rl_collision_avoidance/venv/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 1748, in init
self._traceback = tf_stack.extract_stack()
`
How to solve it? I really need your help. Thanks~

about checkpoints

Hello,here is an error when running this command: ./train.sh TrainPhase1 as follows:

Entered virtualenv.
--------------------------------------------------------------------------------------------------------
Running GA3C-CADRL gym-collision-avoidance training script (TrainPhase1)
--------------------------------------------------------------------------------------------------------
[Server] Making model...
[Server] Loading Regression Model then training RL.
[NetworkVPCore] Loading checkpoint file: /home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/ga3c/GA3C/checkpoints/regression/wandb/run-rnn/checkpoints/network_00000000
Traceback (most recent call last):
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call
    return fn(*args)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn
    target_list, run_metadata)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.DataLossError: not an sstable (bad magic number)
	 [[{{node save/RestoreV2}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "Run.py", line 77, in <module>
    Server().main()
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/ga3c/GA3C/Server.py", line 72, in __init__
    self.model.load(learning_method='regression')
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/ga3c/GA3C/NetworkVPCore.py", line 249, in load
    self.saver.restore(self.sess, filename)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py", line 1290, in restore
    {self.saver_def.filename_tensor_name: save_path})
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 956, in run
    run_metadata_ptr)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1180, in _run
    feed_dict_tensor, options, run_metadata)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1359, in _do_run
    run_metadata)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1384, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.DataLossError: not an sstable (bad magic number)
	 [[node save/RestoreV2 (defined at /home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py:1748) ]]

Original stack trace for 'save/RestoreV2':
  File "Run.py", line 77, in <module>
    Server().main()
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/ga3c/GA3C/Server.py", line 63, in __init__
    self.model = self.make_model()
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/ga3c/GA3C/Server.py", line 89, in make_model
    return globals()[Config.NET_ARCH](Config.DEVICE, Config.NETWORK_NAME, self.num_actions) # TODO can probably change Config.NETWORK_NAME to Config.NET_ARCH
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/ga3c/GA3C/NetworkVP_rnn.py", line 41, in __init__
    super(self.__class__, self).__init__(device, model_name, num_actions)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/ga3c/GA3C/NetworkVPCore.py", line 60, in __init__
    self.saver = tf.compat.v1.train.Saver({var.name: var for var in vars}, max_to_keep=0)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py", line 828, in __init__
    self.build()
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py", line 840, in build
    self._build(self._filename, build_save=True, build_restore=True)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py", line 878, in _build
    build_restore=build_restore)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py", line 508, in _build_internal
    restore_sequentially, reshape)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py", line 328, in _AddRestoreOps
    restore_sequentially)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py", line 575, in bulk_restore
    return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/ops/gen_io_ops.py", line 1696, in restore_v2
    name=name)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/framework/op_def_library.py", line 794, in _apply_op_helper
    op_def=op_def)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 3357, in create_op
    attrs, op_def, compute_device)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 3426, in _create_op_internal
    op_def=op_def)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 1748, in __init__
    self._traceback = tf_stack.extract_stack()

I guess it is due to the checkpoints with episode, and does the network_00000000 is the trained network or the network we need to train? And I open the file network_00000000:
version https://git-lfs.github.com/spec/v1
oid sha256:fb8c752a6b6a78d8cb74bf83ae656e0e4b681e72fa915f58d4886b9a0acdaa0a
size 403965
This web can not open. ​I really don't have any solution about it. how to solved it? could you help me? Thank you very much!

_Originally posted by @BingHan0458 in #5 (comment)

Not able to train the model on GPU

I am getting the error:
'could not retrieve CUDA device count: CUDA_ERROR_NOT_INITIALIZED: initialization error' (Both on Google Colab and Personal device) and training happens on CPU.
It has come to my notice that this issue might have been resulted due to multiprocessing, but I'm not able to figure out what changes I need to make. Please provide some assistance if possible, meanwhile i'm trying to look for a solution elsewhere.

Issue with downloading Regression dataset

Hello,

The regression datasets provided in the folder 'mit_acl/rl_cllision_avoidance/ga3c/GA3C/datasets' are not downloadable.
It would be really helpful if the issue is rectified soon.

Thanks,
Sacheet Amblekar

Test Cases in FullTestSuite

Hello, how were the test cases generated in the full test suite? Is there a code for it?
Also, in the test cases folder, there is no test case file for 20 Agents, could you please upload it in the repo?

Run experiments without AWS

Hello, Everett
Thanks you for your contribution.
I'm trying to train RL algorithm and want to run the robot without AWS.
It it possible to run w/o AWS?

Thanks

Modifying State Vectors

Is it possible to modify the length of the state vectors, especially the "other_agents_states" vector?
I tried modifying the vector lengths and the variable definitions in Config but on running training phase 1 I observe errors showing inconsistencies in tensor length. Do I have to rerun regression before I run phase 1 training if I modify vector lengths?

Visualization

Hello, I want to know how can I watch the result in simulator? what should I set for?

Issue including GA3C-CADRL agents in training environment

In the current code, I have seen that {non-ccoperative policy, static policy, learning policy} are included in the environment while training. I tried to include GA3C-CADRL policy too. But in the network initialization step of GA3CCADRL Policy, the tensorflow session takes forever to run.
Is this something you have experimented with? I wanted to know if this was tried out before and if there are any known solutions to this problem?

Issue with RL Phase 2 Training

Hello,
I get this error, 'ValueError: could not broadcast input array from shape (26,) into shape (68,)' during phase 2 training. Now that there are more agents, it makes sense to have state space of (68,), but I'm not able to understand why input observation is still of shape (26,), even though we set number of agents to be 10.

Cannot execute ./install.sh

Hello, thanks for sharing your awesome work. I'm a beginner about this field and this is the first time I learn about it. I have been troubled by the above questions for a long time. I hope you can help me, thank you very much!

WhenI want to execute. / install.sh,I have a error!

`(avoidance) he@he-Lenovo-Legion-R7000P2020H:~/drl-test/src/rl_collision_avoidance$ ./install.sh

Python 3.6.9 :: Anaconda, Inc.
Your python version is: . Please replace it with Python 3.4-3.7 so we can use tensorflow 1.`

Python=3.6.9,tensorflow=1.14.
I don't how to solve it.
Thank you very much!

Question about how to train code as single agent

Hello, Mr. Everett.
How can I run your GA3C code as single agent?
I try to changed the config(self.TRAIN_SINGLE_AGENT to True), but it is give me an error.
I need only one agent to be trained on the conditions I make for it.
so that, our agent will be trained with the "learning_ga3c" algorithm(with my policy that I make for it) and the other agents of environment using "GA3C_CADRL" method that i create the same trajectory before with "run_trajectory_dataset_creator.sh"(with GA3C_CADRL method)
Could you please explain to me how can i do it?

ModuleNotFoundError: No module named 'numpy'

Hello, I got an error when running this command: "./train.sh TrainPhase1" as follows:
`Entered virtualenv.

Running GA3C-CADRL gym-collision-avoidance training script (TrainPhase1)

Traceback (most recent call last):
File "Run.py", line 31, in
import Config
File "/catkin_ws/src/CADRL/rl_collision_avoidance/ga3c/GA3C/Config.py", line 27, in
import numpy as np
ModuleNotFoundError: No module named 'numpy'
but in my linux, this 'numpy' package has been already installed in two versions of python(2.7 and 3.6):~/catkin_ws/src/CADRL/rl_collision_avoidance$ pip3 install numpy
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (1.19.5)
~/catkin_ws/src/CADRL/rl_collision_avoidance$ pip install numpy
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (1.19.5)
`
and there is not error when I run "import numpy" in interactive environment of python2 and python3:

python3
Python 3.6.9 (default, Oct 8 2020, 12:12:24)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import numpy
exit()

python
Python 2.7.17 (default, Sep 30 2020, 13:38:04)
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import numpy
exit()

I guess that due to the high version of numpy1.19.5? If so, what version should I install?
I don't how to solve it.
Thank you very much!

tensorflow/core/util/events_writer.cc:108] Write failed because file could not be opened.

Hello, I'm sorry about that I got an error again. The following results are got when I run ./train.sh TrainPhase1

[Time:       73] [Episode:     2482 Score:    -0.3096] [RScore:     0.0788 RPPS:  3934] [PPS:  3818 TPS:    29] [NT:  2 NP:  2 NA: 32]
[Time:       74] [Episode:     2483 Score:    -0.2500] [RScore:     0.0776 RPPS:  3932] [PPS:  3817 TPS:    29] [NT:  2 NP:  2 NA: 32]
[Time:       74] [Episode:     2484 Score:    -0.4117] [RScore:     0.0762 RPPS:  3940] [PPS:  3816 TPS:    29] [NT:  2 NP:  2 NA: 32]
2021-03-25 22:01:55.812621: E tensorflow/core/util/events_writer.cc:108] Write failed because file could not be opened.
2021-03-25 22:01:55.812772: E tensorflow/core/util/events_writer.cc:108] Write failed because file could not be opened.
2021-03-25 22:01:55.812847: E tensorflow/core/util/events_writer.cc:108] Write failed because file could not be opened.
[Time:       74] [Episode:     2485 Score:    -0.3115] [RScore:     0.0764 RPPS:  3923] [PPS:  3810 TPS:    29] [NT:  2 NP:  2 NA: 32]
[Time:       74] [Episode:     2486 Score:    -0.3202] [RScore:     0.0760 RPPS:  3906] [PPS:  3810 TPS:    29] [NT:  2 NP:  2 NA: 32]
[Time:       74] [Episode:     2487 Score:     0.1893] [RScore:     0.0766 RPPS:  3914] [PPS:  3814 TPS:    29] [NT:  2 NP:  2 NA: 32]

How to deal with the bug about tensorflow/core/util/events_writer.cc:108] Write failed because file could not be opened.
Thank you very much!

Modifying State Vectors & collect_regression_dataset

Hi,

I try to achieve a similar purpose as mentioned in #10 (modifying state vector). But I am not sure how to achieve it.

I suppose I need to run the collect_regression_dateset.sh (rl_collision_avoidance/gym-collision-avoidance /gym_collision_avoidance/ experiments/ collect_regression_dataset.sh) and then set "TRAIN_ONLY_REGRESSION" in Config?

You mentioned that you have modified the observation vector for a recent project. Could you please point me to this branch so that I can learn from those changes that you have made?

Thanks~

No matching distribution found for tensorflow==1.15.2 (from gym-collision-avoidance===1.0.0)

Hello, thanks for sharing your awesome work. I'm a beginner about this field and this is the first time I learn about it. I have been troubled by the above questions for a long time. I hope you can help me, thank you very much!

  1. when I run ./install.sh, I got some bug as follows:
    Obtaining file:///home/hb/catkin_ws/src/rl_collision_avoidance/gym-collision-avoidance Collecting tensorflow==1.15.2 (from gym-collision-avoidance===1.0.0) Could not find a version that satisfies the requirement tensorflow==1.15.2 (from gym-collision-avoidance===1.0.0) (from versions: 0.12.0rc0, 0.12.0rc1, 0.12.0, 0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.10.1, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.2, 1.12.3, 1.13.0rc0, 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 2.0.0a0, 2.0.0b0, 2.0.0b1) No matching distribution found for tensorflow==1.15.2 (from gym-collision-avoidance===1.0.0)
    I find it is due to python3 -m pip install -e $DIR in /rl_collision_avoidance/gym-collision-avoidance/install.sh.
    Now I use python3.5, tehsorflow1.15.2. And I guess this problem is due to inconsistent version? Is that ture?

  2. When I delete this code python3 -m pip install -e $DIR and run again, there is another bug as follows:
    `Collecting git+https://github.com/openai/baselines.git
    Cloning https://github.com/openai/baselines.git to /tmp/pip-0g8mhuix-build
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/baselines.egg-info
    writing dependency_links to pip-egg-info/baselines.egg-info/dependency_links.txt
    writing requirements to pip-egg-info/baselines.egg-info/requires.txt
    writing pip-egg-info/baselines.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/baselines.egg-info/top_level.txt
    writing manifest file 'pip-egg-info/baselines.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found
    reading manifest file 'pip-egg-info/baselines.egg-info/SOURCES.txt'
    writing manifest file 'pip-egg-info/baselines.egg-info/SOURCES.txt'
    Traceback (most recent call last):
    File "", line 1, in
    File "/tmp/pip-0g8mhuix-build/setup.py", line 58, in
    assert tf_pkg is not None, 'TensorFlow needed, of version above 1.4'
    AssertionError: TensorFlow needed, of version above 1.4

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-0g8mhuix-build/`

Question about how to make Learning cadrl!

Hello, Mr. Everett.
I added an Extended on your last ga3c code and tested it.
and I need extra credit for my article. for that, I will be testing this Extended on your 'cadrl' model.
but I can't find a policy like the 'LearningPolicyGA3C.py', Is there any way to make it?

Debug

Hello, Mr. Everett
I have question, how do you normally debug the code like this when it starts running from a terminal as a bash shell script file ??
Do you use any specific tool? I tried to use a library named pdb but it doesn't work properly.

./train.sh TrainPhase1`

Thank you very much! This bug has been solved due to the import Config. But there is also another error when running this command: ./train.sh TrainPhase1 as follows:

Entered virtualenv.
--------------------------------------------------------------------------------------------------------
Running GA3C-CADRL gym-collision-avoidance training script (TrainPhase1)
--------------------------------------------------------------------------------------------------------
[Server] Making model...
[Server] Loading Regression Model then training RL.
[NetworkVPCore] Loading checkpoint file: /home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/ga3c/GA3C/checkpoints/regression/wandb/run-rnn/checkpoints/network_00000000
Traceback (most recent call last):
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call
    return fn(*args)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn
    target_list, run_metadata)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.DataLossError: not an sstable (bad magic number)
	 [[{{node save/RestoreV2}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "Run.py", line 77, in <module>
    Server().main()
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/ga3c/GA3C/Server.py", line 72, in __init__
    self.model.load(learning_method='regression')
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/ga3c/GA3C/NetworkVPCore.py", line 249, in load
    self.saver.restore(self.sess, filename)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py", line 1290, in restore
    {self.saver_def.filename_tensor_name: save_path})
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 956, in run
    run_metadata_ptr)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1180, in _run
    feed_dict_tensor, options, run_metadata)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1359, in _do_run
    run_metadata)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1384, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.DataLossError: not an sstable (bad magic number)
	 [[node save/RestoreV2 (defined at /home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py:1748) ]]

Original stack trace for 'save/RestoreV2':
  File "Run.py", line 77, in <module>
    Server().main()
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/ga3c/GA3C/Server.py", line 63, in __init__
    self.model = self.make_model()
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/ga3c/GA3C/Server.py", line 89, in make_model
    return globals()[Config.NET_ARCH](Config.DEVICE, Config.NETWORK_NAME, self.num_actions) # TODO can probably change Config.NETWORK_NAME to Config.NET_ARCH
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/ga3c/GA3C/NetworkVP_rnn.py", line 41, in __init__
    super(self.__class__, self).__init__(device, model_name, num_actions)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/ga3c/GA3C/NetworkVPCore.py", line 60, in __init__
    self.saver = tf.compat.v1.train.Saver({var.name: var for var in vars}, max_to_keep=0)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py", line 828, in __init__
    self.build()
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py", line 840, in build
    self._build(self._filename, build_save=True, build_restore=True)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py", line 878, in _build
    build_restore=build_restore)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py", line 508, in _build_internal
    restore_sequentially, reshape)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py", line 328, in _AddRestoreOps
    restore_sequentially)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py", line 575, in bulk_restore
    return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/ops/gen_io_ops.py", line 1696, in restore_v2
    name=name)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/framework/op_def_library.py", line 794, in _apply_op_helper
    op_def=op_def)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 3357, in create_op
    attrs, op_def, compute_device)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 3426, in _create_op_internal
    op_def=op_def)
  File "/home/hanbin/catkin_ws/src/CADRL/rl_collision_avoidance/venv/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 1748, in __init__
    self._traceback = tf_stack.extract_stack()

I guess it is due to the checkpoints with episode, and does the network_00000000 is the trained network or the network we need to train? I really don't have any solution about it. how to solved it? could you help me? Thank you very much!

Originally posted by @BingHan0458 in #5 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.