-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Fix] Several bugs #852
base: 1.0
Are you sure you want to change the base?
[Fix] Several bugs #852
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,6 +182,8 @@ | |
|
||
img = raw_img.copy() | ||
cam2img = copy.deepcopy(cam2img) | ||
if len(bboxes3d.tensor) is 0: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW just to make sure if this modification is necessary, the code will cause an error if no box is presented right? |
||
return img | ||
corners_3d = bboxes3d.corners | ||
num_bbox = corners_3d.shape[0] | ||
points_3d = corners_3d.reshape(-1, 3) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,7 +149,7 @@ def _load_points(self, pts_filename): | |
points = np.frombuffer(pts_bytes, dtype=np.float32) | ||
except ConnectionError: | ||
mmcv.check_file_exist(pts_filename) | ||
if pts_filename.endswith('.npy'): | ||
if pts_filename.endswith('.npy') or pts_filename.endswith('.npz'): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The loaded |
||
points = np.load(pts_filename) | ||
else: | ||
points = np.fromfile(pts_filename, dtype=np.float32) | ||
|
@@ -390,7 +390,7 @@ def _load_points(self, pts_filename): | |
points = np.frombuffer(pts_bytes, dtype=np.float32) | ||
except ConnectionError: | ||
mmcv.check_file_exist(pts_filename) | ||
if pts_filename.endswith('.npy'): | ||
if pts_filename.endswith('.npy') or pts_filename.endswith('.npz'): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
points = np.load(pts_filename) | ||
else: | ||
points = np.fromfile(pts_filename, dtype=np.float32) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ def __init__(self, *args, **kwargs): | |
def forward(self, input): | ||
assert input.dtype == torch.float32, \ | ||
f'input should be in float32 type, got {input.dtype}' | ||
if dist.get_world_size() == 1 or not self.training: | ||
if not dist.is_initialized() or dist.get_world_size() == 1 or not self.training: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we can add a comment indicating that |
||
return super().forward(input) | ||
assert input.shape[0] > 0, 'SyncBN does not support empty inputs' | ||
C = input.shape[1] | ||
|
@@ -108,7 +108,7 @@ def __init__(self, *args, **kwargs): | |
def forward(self, input): | ||
assert input.dtype == torch.float32, \ | ||
f'input should be in float32 type, got {input.dtype}' | ||
if dist.get_world_size() == 1 or not self.training: | ||
if not dist.is_initialized() or dist.get_world_size() == 1 or not self.training: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
return super().forward(input) | ||
|
||
assert input.shape[0] > 0, 'SyncBN does not support empty inputs' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function will be deprecated soon and we won't use it in the future. Your fix are correct but I'd suggest you not using this function in your code :)