Open mbjurca opened 7 months ago
Thanks for your attention. You can follow the format of ScannetDataset to load depth maps:
def __init__():
all_depth_files = []
for ...
depth_files = [f.replace("pose", "depth").replace("txt", "png") for f in pose_files]
self.all_depth_files = np.array(all_depth_files, dtype=object)[index]
def __getitem():
depth_files = self.all_depth_files[real_idx]
....
img = Image.open(depth_files[id_render])
depth = np.asarray(img, dtype=np.float32) / 1000.0 # mm -> m
depth = np.ascontiguousarray(depth, dtype=np.float32)
depth = cv2.resize(depth, (self.w, self.h), interpolation=cv2.INTER_NEAREST)
....
return {
....
"true_depth": torch.from_numpy(depth),
....
}
Meanwhile, use single GPU to train may not unable to produce best results due to our method contains a perception head.
Thank you for the reply, but as I said I already added the missing elements for the Replica dataset. The problem happens in the model.sem_seg_head
. ret['outputs_fine']['feats_out']
is outputting a tensor of shape (400, 512) and not a dictionary as expected, yielding the error mentioned before. Also, I see that there are some depth processing going on, does that mean the model is using the depth masks to get a better prediction even if the depth_loss_scale in the config file is set to 0?
This is my configuration file for the train:
### INPUT
expname = gnt_replica
rootdir = ./
render_stride = 2
distributed = False
## dataset
train_dataset = train_replica
dataset_weights = [1]
eval_dataset = val_replica
val_set_list = configs/replica_test_split.txt
original_width = 640
original_height = 480
### TRAINING
N_rand = 400
lrate_feature = 0.005
lrate_semantic = 0.005
lrate_gnt = 0.00001
lrate_decay_factor = 0.6
lrate_decay_steps = 4000
single_net = True
trans_depth = 8
### TESTING
chunk_size = 2000
### RENDERING
N_importance = 16
N_samples = 48
inv_uniform = True
white_bkgd = False
### CONSOLE AND TENSORBOARD
total_step = 16000
i_print = 100
save_interval = 2000
### SEMANTIC SETTING
save_feature = True
semantic_model = fpn
###
render_loss_scale = 0.25
semantic_loss_scale = 0.75
distill_loss_scale = 0.5
depth_loss_scale = 0
num_classes = 46
ignore_label = 47
Thank you for your contribution. I would like to train the model from scratch on the Replica dataset but without the depth-guided loss. I ran the following command:
CUDA_VISIBLE_DEVICES=1 python train_gpnerf.py --config configs/gpnerf_replica.txt --expname debug --ckpt_path ./out/gnt_best.pth --no_load_opt --no_load_scheduler
but, the follwing error occurs:In the ReplicaDataset I don't see the
depth_mask
key in__getitem__
. I added the field as in the ScanNet dataset but I get a new error:Can you please guide me on how to choose the correct configuration and the changes to be made so that I can train the desired model?