Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MinkowskiEngine 0.5.4][ME.RegionType.HYBRID vs ME.RegionType.CUSTOM] ME.RegionType.CUSTOM giving AttributeError: 'NoneType' object has no attribute 'numel' #51

Closed
sandeepnmenon opened this issue Jun 23, 2021 · 5 comments

Comments

@sandeepnmenon
Copy link

sandeepnmenon commented Jun 23, 2021

Hi @chrischoy
I am trying to run the code in presumably written with the 0.4.3 MinkowskiEngine but my version in 0.5.4

ConvType.SPATIAL_HYPERCUBE_TEMPORAL_HYPERCROSS: ME.RegionType.HYBRID

Which uses ME.RegionType.HYBRID.
I replaced HYPERCUBE and HYPERCROSS to HYPER_CUBE and HYPER_CROSS respectively. Then I replaced ME.RegionType.HYBRID with ME.RegionType.CUSTOM in the above mentioned line.

I am getting the following error

Traceback (most recent call last):
  File "/home/anaconda3/envs/py3-mink/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/anaconda3/envs/py3-mink/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/SandeepMenon/SpatioTemporalSegmentation/main.py", line 156, in <module>
    main()
  File "/home/SandeepMenon/SpatioTemporalSegmentation/main.py", line 117, in main
    model = NetClass(num_in_channel, num_labels, config)
  File "/home/SandeepMenon/SpatioTemporalSegmentation/models/res16unet.py", line 339, in __init__
    super(STRes16UNetBase, self).__init__(in_channels, out_channels, config, D, **kwargs)
  File "/home/SandeepMenon/SpatioTemporalSegmentation/models/res16unet.py", line 23, in __init__
    super(Res16UNetBase, self).__init__(in_channels, out_channels, config, D)
  File "/home/SandeepMenon/SpatioTemporalSegmentation/models/resnet.py", line 25, in __init__
    self.network_initialization(in_channels, out_channels, config, D)
  File "/home/SandeepMenon/SpatioTemporalSegmentation/models/res16unet.py", line 58, in network_initialization
    self.block1 = self._make_layer(
  File "/home/SandeepMenon/SpatioTemporalSegmentation/models/resnet.py", line 106, in _make_layer
    block(
  File "/home/SandeepMenon/SpatioTemporalSegmentation/models/modules/resnet_block.py", line 23, in __init__
    self.conv1 = conv(
  File "/home/SandeepMenon/SpatioTemporalSegmentation/models/modules/common.py", line 128, in conv
    kernel_generator = ME.KernelGenerator(
  File "/home/anaconda3/envs/py3-mink/lib/python3.8/site-packages/MinkowskiEngine/MinkowskiKernelGenerator.py", line 303, in __init__
    self.kernel_volume = get_kernel_volume(
  File "/home/anaconda3/envs/py3-mink/lib/python3.8/site-packages/MinkowskiEngine/MinkowskiKernelGenerator.py", line 91, in get_kernel_volume
    region_offset.numel() > 0
AttributeError: 'NoneType' object has no attribute 'numel'


While trying to create an ME.KernelGenerator
using the following params

ME.KernelGenerator(
      3, 1, 1, region_type=ME.RegionType.CUSTOM, axis_types=[<RegionType.HYPER_CUBE: 0>, <RegionType.HYPER_CUBE: 0>, <RegionType.HYPER_CUBE: 0>, <RegionType.HYPER_CROSS: 1>], dimension=4)

It is because I am not providing region_offsets. Can you help me understand offsets to give in this case?
How to use the ME.RegionType.CUSTOM type in replacement to this?
Else, how to install MinkowskiEngine 0.4.3. I dont see an archive.

Thank you

@suyunzzz
Copy link

@sandeepnmenon hello,MinkowskiEngine 0.4.3 at here : https://github.com/NVIDIA/MinkowskiEngine/releases/tag/v0.4.3

@sandeepnmenon
Copy link
Author

@suyunzzz Thank you
Closing the issue.

@saltoricristiano
Copy link

Hey @sandeepnmenon,

did you solve the issue in the end? I'm using mink v 0.5 but the HYBRID kernel is not available yet.

@sandeepnmenon
Copy link
Author

@saltoricristiano
No, I could not solve it in v0.5.
I solved the issue by using v0.4.3 in my environment.

@HaFred
Copy link

HaFred commented Dec 1, 2022

Hey @sandeepnmenon,

did you solve the issue in the end? I'm using mink v 0.5 but the HYBRID kernel is not available yet.

I found that Chris did have a branch for v0.5, that can solve the region type update issue. See this commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants