Closed muzi2045 closed 4 years ago
@muzi2045 Thank you for your comment. The output needs to be 12 channels of 0-11 and there are 4-9 for the classes. You're right, master's latest has 4 classifications, and you don't need 8,9, but it doesn't matter if you have 6 channels. If you change the class number, you will also need to change the subsequent channels (such as height_pt) of the inference part.
thanks for your reply! there is another place make me confused when training:
for index, (in_feature, out_feature_gt) in enumerate(train_dataloader):
out_feature_gt_np = out_feature_gt.detach().numpy().copy() #NHWC
pos_weight = out_feature_gt.detach().numpy().copy() #NHWC
pos_weight = pos_weight[:, 3, ...]
object_idx = np.where(pos_weight == 0)
nonobject_idx = np.where(pos_weight != 0)
class_weight = out_feature_gt.detach().numpy().copy()
class_weight = class_weight[:, 4:5, ...]
why the pos_weight = pos_weight[ : , 3, ...]
?
the out_feature_gt tensor should be NHWC , so it should be pos_weight = pos_weight[ :, : ,: , 0]
@kosuke55
@muzi2045 Have you checked the shape? I think the shape is NCHW as in (1, 12, 672, 672). Maybe it was NHWC in the old code and you're confused.
Yes, I find where do the tensor transform, this part make NHWC -> NCHW
transform = transforms.Compose([
transforms.ToTensor()])
thanks a lot.
I saw the newest repo code and found that:
when trained with nuscenes dataset, the class label setting is [0, 1, 2, 3]
out_feature[i, j, 4] = label # classify_pt
But when training, the preprocess part is
one_hot_class = onehot(out_feature[..., 4].astype(np.int8), 6)
is that right ? or maybe the onehot func should change according to the class num to predict, @kosuke55