bednarikjan / temporally_coherent_surface_reconstruction

Implementation of the ICCV'21 paper Temporally-Coherent Surface Reconstruction via Metric-Consistent Atlases
GNU General Public License v3.0
57 stars 7 forks source link

Errors found when run the code #1

Closed zili-zhou closed 2 years ago

zili-zhou commented 3 years ago

Hi, I have found some errors when I try to run the train.py.

Dataset: I select "camel-poses" in animal dataset.

In the process "Train", when I set the input data folder in tcsr/data/data_loader.py and output folder in tcsr/train/configs/our_anim.yaml, I run the train.py with command "python train.py --conf configs/our_anim.yaml".

1.File ".../tcsr/tcsr/models/encoder.py", line 13, in from tcsr.train.helpers import Device ImportError: cannot import name 'Device' from partially initialized module 'tcsr.train.helpers' (most likely due to a circular import) (.../tcsr/tcsr/train/helpers.py)

This error happens because "helpers.py" import somthing from "encoder.py" but "class Device" is defined in "helpers.py", which is imported also in "encoder.py", cause the circular error.

2.File ".../tcsr/tcsr/train/train.py", line 77, in model = tr_helpers.create_model_train(conf, num_cws=len(ds)) TypeError: create_model_train() got an unexpected keyword argument 'num_cws' There is no augument "num_cws" in function "create_model_train(conf, num_cws=len(ds))" in helpers.py

3.Traceback (most recent call last): File "/home/zzl/tcsr2.0/tcsr/tcsr/train/train.py", line 77, in model = tr_helpers.create_model_train(conf) File "/home/zzl/tcsr2.0/tcsr/tcsr/train/helpers.py", line 190, in create_model_train alphas_sciso=conf['alphas_sciso'], loss_mmcl=conf['loss_mmcl'], KeyError: 'loss_mmcl' In "class ModelMetricConsistency(nn.Module, Device)" in models_mc.py, there is no augument "loss_mmcl" and also there is no "loss_mmcl" found in "our_anim.yaml".

4.Traceback (most recent call last): File ".../tcsr/tcsr/train/train.py", line 141, in losses = model.loss( File ".../tcsr/tcsr/models/models_mc.py", line 308, in loss L_mc = self.loss_mc_no_interp(EFG=efg) AttributeError: 'ModelMetricConsistency' object has no attribute 'loss_mc_no_interp'

In "loss()" function in "models_mc.py", if loss_mc == True, Metric consistency is used but " L_mc = self.loss_mc_no_interp(EFG=efg)", loss_mc_no_interp() is used without defined.

5.Traceback (most recent call last): File ".../tcsr/tcsr/train/train.py", line 141, in losses = model.loss( File ".../tcsr/tcsr/models/models_mc.py", line 315, in loss L_ssc = self._loss_self_supervised_correspondences( File ".../tcsr/tcsr/models/models_mc.py", line 264, in _loss_self_supervised_correspondences inds_p2gt = self._reg_func_impl(pc_gt[:, 0], pc_p[:, 0])[0] # (B, M)

AttributeError: 'ModelMetricConsistency' object has no attribute '_reg_func_impl'

In "loss()" function in "models_mc.py", if loss_ssc == True, Self-supervised correspondences is used. "L_ssc = self._loss_self_supervised_correspondences()", in function _loss_self_supervised_correspondences(), there is a line "inds_p2gt = self._reg_func_impl(pc_gt[:, 0], pc_p[:, 0])[0]", _reg_func_impl() is used but noe defined.

After set loss_mc and loss_ssc is False, it can run.

bednarikjan commented 2 years ago

Hi Zili, thank you for listing the errors! It should be all fixed now, please update the repo.