safe-rl / safe-rl-shielding

MIT License
38 stars 12 forks source link

Running self-driving-car #44

Open yydyurisa opened 5 months ago

yydyurisa commented 5 months ago

Hello,I ran into some issues when I tried to run your self-driving project, so I was hoping you could help me out.

First, whether the project has a README.md document to refer to;

Second, after I installed the dependencies using python setup.py install, When running the project with the command python grid_search.py -c=self-driving-car_no_shield --num-steps=1000000 -v, I encountered the following problems:

trying h_layers: 3 nodes: 8 target model update: 0.01 lr: 0.001
/home/yurisa/桌面/原代码/safe-rl-shielding-master/envs/self-driving-car/rl/memory.py:29: UserWarning: Not enough entries to sample without replacement. Consider increasing your warm-up phase to avoid oversampling!
  warnings.warn('Not enough entries to sample without replacement. Consider increasing your warm-up phase to avoid oversampling!')
Traceback (most recent call last):
  File "grid_search.py", line 77, in <module>
    model_desc = main()
  File "grid_search.py", line 70, in main
    total_time = fit_test(dqn, env, weight_name)
  File "grid_search.py", line 40, in fit_test
    train_history = dqn.fit(env, nb_steps=steps, visualize=False, verbose=0)
  File "/home/yurisa/桌面/原代码/safe-rl-shielding-master/envs/self-driving-car/rl/core.py", line 386, in fit
    metrics = self.backward(reward, terminal=done)
  File "/home/yurisa/桌面/原代码/safe-rl-shielding-master/envs/self-driving-car/rl/agents/dqn.py", line 320, in backward
    metrics = self.trainable_model.train_on_batch(ins + [targets, masks], [dummy_targets, targets])
  File "/home/yurisa/anaconda3/envs/py2/lib/python2.7/site-packages/keras/engine/training.py", line 1761, in train_on_batch
    self._make_train_function()
  File "/home/yurisa/anaconda3/envs/py2/lib/python2.7/site-packages/keras/engine/training.py", line 960, in _make_train_function
    loss=self.total_loss)
TypeError: get_updates() takes exactly 4 arguments (3 given)

How can I solve the above problem!!!