-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random seed works at 0.15.1 segment_plane but not works at 0.16.0 #5647
Comments
Since 0.16.0, the |
You mean it's not a bug?But setting seed is to achieve a stable result. |
You may try to set the new arg |
After experiments, the results are different each time. |
The random seed is singleton so you should reset the random seed before import numpy as np
import open3d as o3d
o3d.utility.random.seed(1)
pcd = o3d.io.read_point_cloud('1.ply')
pcd_down = pcd.voxel_down_sample(voxel_size=0.01)
plane_model, inliers = pcd_down.segment_plane(distance_threshold=0.02,
ransac_n=5,
num_iterations=5000,
probability=1)
o3d.utility.random.seed(1)
plane_model, inliers2 = pcd_down.segment_plane(distance_threshold=0.02,
ransac_n=5,
num_iterations=5000,
probability=1)
print(np.all(np.array(inliers) == np.array(inliers2))) |
thank you |
For large plane fitting, it is not work at 0.16 |
I have also observed this issue with 0.16 and 0.17 |
I set seed before each call and probability=1.0 - and it still doesn't make this deterministic. I also get different value every time (and in some cases it can vary a lot if the points are sparse). This means I cannot make tests. Any idea on how to fix this? This means I might need to revert to 0.15, but that doesn't seem like a long term solution. |
Hi @TheExDeus @conorsim, could you provide the data or the code snippet to reproduce the bug? |
@yuecideng if I test your code above with version 0.17.0 I don't get the same values. I made a couple of changes:
When I run this, the output I got was
So, in this run it was correct only 1/10 times. |
Hi @conorsim, you are right! this may be caused by the update of best estimated model among multi threading. I will try to investigate it. |
The issue has been solved by PR #6308. |
Checklist
master
branch).Describe the issue
Random seed works at 0.15.1 segment_plane but not works at 0.16.0
Steps to reproduce the bug
Error message
None
Expected behavior
The result of 0.16 should be the same as that of 0.15
Open3D, Python and System information
Additional information
Random seed works at 0.15.1 segment_plane but not works at 0.16.0
The text was updated successfully, but these errors were encountered: