question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Re-create Figure 6 in "Safe Learning in Robotics" errors

See original GitHub issue

Hey Jacopo,

Thanks for the great review paper and open sourcing the accompanying codes here.

I would like to reproduce Figure 6 by following commands but got error messages after successfully loading five GP models as

#########################################
#       Loading GP dimension 5         #
#########################################
Path: ./trained_gp_model/best_model_5.pth
Loaded!
Traceback (most recent call last):
  File "./gp_mpc_experiment.py", line 179, in <module>
    ctrl.learn()
  File "/home/jwang/Control_ws/src/safe-control-gym/safe_control_gym/controllers/mpc/gp_mpc.py", line 809, in learn
    self.reset()
  File "/home/jwang/Control_ws/src/safe-control-gym/safe_control_gym/controllers/mpc/gp_mpc.py", line 899, in reset
    self.setup_gp_optimizer(n_ind_points)
  File "/home/jwang/Control_ws/src/safe-control-gym/safe_control_gym/controllers/mpc/gp_mpc.py", line 562, in setup_gp_optimizer
    mean_post_factor_val, Sigma, K_zind_zind_inv, z_ind_val = self.precompute_sparse_gp_values(n_ind_points)
  File "/home/jwang/Control_ws/src/safe-control-gym/safe_control_gym/controllers/mpc/gp_mpc.py", line 394, in precompute_sparse_gp_values
    inds, dist_mat = pairwise_distances_argmin_min(centroids, inputs[:, self.input_mask])
  File "/home/jwang/anaconda3/envs/safe/lib/python3.8/site-packages/sklearn/metrics/pairwise.py", line 680, in pairwise_distances_argmin_min
    values, indices = PairwiseDistancesArgKmin.compute(
  File "sklearn/metrics/_pairwise_distances_reduction.pyx", line 672, in sklearn.metrics._pairwise_distances_reduction.PairwiseDistancesArgKmin.compute
  File "sklearn/metrics/_pairwise_distances_reduction.pyx", line 1055, in sklearn.metrics._pairwise_distances_reduction.FastEuclideanPairwiseDistancesArgKmin.__init__
  File "sklearn/metrics/_dist_metrics.pyx", line 1300, in sklearn.metrics._dist_metrics.DatasetsPair.get_for
  File "sklearn/metrics/_dist_metrics.pyx", line 1349, in sklearn.metrics._dist_metrics.DenseDenseDatasetsPair.__init__
  File "stringsource", line 658, in View.MemoryView.memoryview_cwrapper
  File "stringsource", line 349, in View.MemoryView.memoryview.__cinit__
ValueError: ndarray is not C-contiguous

I wonder if you could help with this? Thank you.

Regards, Jie

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
JacopoPancommented, Jul 14, 2022

https://arxiv.org/abs/2109.06325 (it is now officially an IROS/RA-L paper)

1reaction
jwangjiecommented, Jul 13, 2022

@adamhall The plot looks pretty much the same as this one with both the existing and retrained models.

Read more comments on GitHub >

github_iconTop Results From Across the Web

From Learning-Based Control to Safe Reinforcement Learning
We highlight some of the open challenges that will drive the field of robot learning in the coming years, and em- phasize the...
Read more >
utiasDSL/safe-control-gym: PyBullet CartPole and Quadrotor ...
Re-create the Results in "Safe Learning in Robotics" [arXiv link] · Figure 6—Robust GP-MPC [1] · Figure 7—Safe RL Exploration [2] · Figure...
Read more >
Safe Robot Learning in Assistive Devices through Neural ...
In this paper, we derive an algorithm for training neural networks controllers to satisfy given safety specifications, in addition to fitting the given ......
Read more >
Active learning in robotics: A review of control principles
This is a review of active learning in robotics, focusing on methods amenable to the demands ... 3(c)) while also achieving lower stabilization...
Read more >
Reinforcement Learning in Robotics: A Survey
Figure 1: This figure illustrates a small sample of robots with behaviors that were re- inforcement learned. These cover the whole range of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found