LiyaoTang / contrastBoundary

Contrastive Boundary Learning for Point Cloud Segmentation (CVPR2022)
MIT License
139 stars 11 forks source link

Where is the definition of config.dense_by_conv? #10

Closed whuhxb closed 2 years ago

whuhxb commented 2 years ago

Hi,

where to find the definition of config.dense_by_conv in config file? I have try to revise the code onto another task, but met a bug in dealing with this. Thanks.

Best.

LiyaoTang commented 2 years ago

Hi.

It is quite tricky, as I modify the config file during the import stage. It is only for debug use and turns out to be not necessary.

Specifically, by setting dense_by_conv, the code use the 1x1conv instead of the dense_layer to perform a single linear mapping.

whuhxb commented 2 years ago

@LiyaoTang I still have no idea to deal with this problem now. Could you please provide more details about how to set dense_by_conv now? In which file? Thanks.

LiyaoTang commented 2 years ago

Hi. Could you provide the error message? Or, what is the problem you are trying to solve?

whuhxb commented 2 years ago

@LiyaoTang I try to run the CBL on another dataset, and replace the models file from CloserLook3D with models file from CBL, but I have met this error, the lost definition of dense_by_conv. The error is like this:

Traceback (most recent call last): File "function/train_evaluate_sensaturban.py", line 585, in save_path = training(config) File "function/train_evaluate_sensaturban.py", line 137, in training SceneSegModel(flat_inputs[0], is_training_pl, config=config) File "/**/models/build_models.py", line 182, in init if config.dense_by_conv: AttributeError: 'EasyDict' object has no attribute 'dense_by_conv'

whuhxb commented 2 years ago

@LiyaoTang How to solve this problem? The definition of dense_by_conv.

LiyaoTang commented 2 years ago

Hi, it seems that you use easydict as config, which I do not use. You can simply set the 'dense_by_conv' and any other unwanted (but leads to an AttributeError) attribute to be empty string ''

whuhxb commented 2 years ago

@LiyaoTang I haven't found config file of dense_by_conv in your tensorflow code, and I have ctrl+F to search in each file. I just find dense_by_conv in models/build_models.py and models/basic_operators.py.

LiyaoTang commented 2 years ago

Yes, you are right and I do not have such config, because as I mentioned before, it was only for debug use, which was set manually. Since it becomes an obstacle in your situation, you can simply set it to empty string, or delete the if clause.

Best.

whuhxb commented 2 years ago

@LiyaoTang OK. Thanks.

whuhxb commented 2 years ago

@LiyaoTang config.dense_by_conv bug solved. But I have met another bug, like this, is it also used for debugging?

models/heads/seg_head.py", line 93, in resnet_scene_segmentation_head if config.sep_head or config.arch_up: AttributeError: 'EasyDict' object has no attribute 'sep_head'

whuhxb commented 2 years ago

@LiyaoTang I try to fuse these two codes to run on another dataset. But, you re-define the config file for each dataset.

LiyaoTang commented 2 years ago

Yes, but I do have a base class defined in config/base.py. You may want to use that.

LiyaoTang commented 2 years ago

I'm sorry that I really cannot help there because it's a new codebase for me.

If you really want to use the easydict, you can check the output of log file, where the training script prints out the config in use. You can then check and set the corresponding attributes into the easydict. However, as you may notice, I provide a default value '' to any un-set attribute.

whuhxb commented 2 years ago

@LiyaoTang To make it simple, I want to use CBL tensorflow version on a new dataset: SensatUrban. This link adopts SensatUrban dataset and works a CloserLook3D. There are two ways to suit CBL on SensatUrban dataset.

  1. If I use the code on SensatUrban dataset, and also use CBL, then I will change the model file to suit it, then I met the error of sep_head and arch_out.
  2. If I use CBL tensorflow code, then I need to change dataloader section to suit it for SensatUrban dataset.

I'm trying these two ways, but I still met errors. And, I'm not sure which way is better. Best regards.

LiyaoTang commented 2 years ago

Hi, I think it's better to go for the second way, as adapting the dataset loader sounds simpler to me.

Yet, if you want to go the first way, you may just copy the config generated from my code (printed out at the beginning of model training) and paste and set each attribute accordingly.

whuhxb commented 2 years ago

@LiyaoTang OK. I'm trying the second way. If any questions, I will seek your help.