NVIDIA / MinkowskiEngine

Minkowski Engine is an auto-diff neural network library for high-dimensional sparse tensors
https://nvidia.github.io/MinkowskiEngine
Other
2.47k stars 367 forks source link

Are those pretrained models `Mink16UNet34C` deprecated? #509

Open HaFred opened 1 year ago

HaFred commented 1 year ago

Describe the bug I tried to use the two pre-trained models Mink16UNet34C provided here with main.py to conduct scannet test set inference. I do realize that some of the code in the master branch of the STS repo needed to be refactored to adapt for ME v0.5, thus I did those refactor only without changing other behaviors.

However, I cannot get the correct segmentation results, e.g., scene0707 inference looks like this with the pretrained mink.

Input Inference
input_0707 readme_weight_0707
I also tried the indoor.py in the STS repo, the inference also failed for ME v0.5.4 as follows. Input Inference
snapshot00 snapshot01

It means that with the pretrained models under STS with the current ME_v0.5.4, I cannot get correct inference output for both scannet test set or indoor.py data. The only way to get successful inference result is to use the weight downloaded here. The results look like this: scene0707 indoor.py
me_weight_scene0707 me_indoor_weight

So my question is, is the pretrained model Mink16UNet34C considered as deprecated for ME v5.4? Thank you.


Desktop (please complete the following information):

Achleshwar commented 1 year ago

Hey @HaFred I am running into a similar issue. Can you please share what all the changes did you make in the train.py to run the inference. Specifically, how did you resolve AttributeError: type object 'MinkowskiEngineBackend._C.RegionType' has no attribute 'HYBRID'? I was following this conversation but I couldn't find a solution for the above-mentioned issue.

HaFred commented 1 year ago

I did the following for this line.

# Covert the ConvType var to a RegionType var
conv_to_region_type = {
    # kernel_size = [k, k, k, 1]
    ConvType.HYPERCUBE: ME.RegionType.HYPER_CUBE,
    ConvType.SPATIAL_HYPERCUBE: ME.RegionType.HYPER_CUBE,
    ConvType.SPATIO_TEMPORAL_HYPERCUBE: ME.RegionType.HYPER_CUBE,
    ConvType.HYPERCROSS: ME.RegionType.HYPER_CROSS,
    ConvType.SPATIAL_HYPERCROSS: ME.RegionType.HYPER_CROSS,
    ConvType.SPATIO_TEMPORAL_HYPERCROSS: ME.RegionType.HYPER_CROSS,
    ConvType.SPATIAL_HYPERCUBE_TEMPORAL_HYPERCROSS: ME.RegionType.CUSTOM  # f: this seems like not used in mink res16unet, but v0.5.4 not supported, so can comment for now
}

# int_to_region_type = {m.value: m for m in ME.RegionType}
# int_to_region_type = {m: ME.RegionType(m) for m in range(3)}
int_to_region_type = {
    0: ME.RegionType.HYPER_CUBE,
    1: ME.RegionType.HYPER_CROSS,
    2: ME.RegionType.CUSTOM
}
Achleshwar commented 1 year ago

Thank you for your response. So far, I have been using MinkowskiNet34C (as shown in indoor.py). While the inference results look good, I am not able to reproduce these quantitative results on Scannet's validation dataset. I think the main reason is that the weights shared in MinkowskiEngine repo and STS repo are different but I am doubting my implementation as well coz I am getting mIOU close to 61 which is a significant difference.

Have you tried benchmarking on Scannet validation split and matching the nos. with STS repo?