Error when loading classifier

For any question related to the 3DMASC forum
Rund
Posts: 8
Joined: Tue Aug 20, 2024 5:40 pm

Error when loading classifier

Post by Rund »

Hi,

When I try to load the classifier saved after the training step I get this error,

\opencv\modules\core\src\alloc.cpp:55: error: (-4) Failed to allocate 262144 bytes in function cv::OutOfMemoryError

Is there anything I can do/change to solve this?

My input point cloud is a fairly small (but dense) point cloud from the SNCF,
https://ressources.data.sncf.com/explor ... formation/

My computer has 32GB of RAM.

This is how my classifier.txt file looks like,
# 3DMASC classifier file
classifier: classifier.yaml
# Clouds (roles)
cloud: PC1
# Core points (classified role)
core_points: PC1
# Features
feature: Dip_SC0.5_PC1
feature: Dip_SC1_PC1
feature: Dip_SC1.5_PC1
feature: Dip_SC2_PC1
feature: DipDir_SC0.5_PC1
feature: DipDir_SC1_PC1
feature: DipDir_SC1.5_PC1
feature: DipDir_SC2_PC1
feature: PCA1_SC0.5_PC1
feature: PCA1_SC1_PC1
feature: PCA1_SC1.5_PC1
feature: PCA1_SC2_PC1
feature: PCA2_SC0.5_PC1
feature: PCA2_SC1_PC1
feature: PCA2_SC1.5_PC1
feature: PCA2_SC2_PC1
feature: PCA3_SC0.5_PC1
feature: PCA3_SC1_PC1
feature: PCA3_SC1.5_PC1
feature: PCA3_SC2_PC1
feature: SPHER_SC0.5_PC1
feature: SPHER_SC1_PC1
feature: SPHER_SC1.5_PC1
feature: SPHER_SC2_PC1
feature: ANISO_SC0.5_PC1
feature: ANISO_SC1_PC1
feature: ANISO_SC1.5_PC1
feature: ANISO_SC2_PC1
feature: LINEA_SC0.5_PC1
feature: LINEA_SC1_PC1
feature: LINEA_SC1.5_PC1
feature: LINEA_SC2_PC1
feature: PLANA_SC0.5_PC1
feature: PLANA_SC1_PC1
feature: PLANA_SC1.5_PC1
feature: PLANA_SC2_PC1
feature: Zmin_SC0.5_PC1
feature: Zmin_SC1_PC1
feature: Zmin_SC1.5_PC1
feature: Zmin_SC2_PC1
feature: Zmax_SC0.5_PC1
feature: Zmax_SC1_PC1
feature: Zmax_SC1.5_PC1
feature: Zmax_SC2_PC1
feature: ZRANGE_SC0.5_PC1
feature: ZRANGE_SC1_PC1
feature: ZRANGE_SC1.5_PC1
feature: ZRANGE_SC2_PC1
paul.leroy
Posts: 40
Joined: Tue Dec 01, 2020 1:21 pm

Re: Error when loading classifier

Post by paul.leroy »

Please provide the classifier.yaml file for testing.
Which laz did you use among the SNCF dataset? There are 16 files available.
Rund
Posts: 8
Joined: Tue Aug 20, 2024 5:40 pm

Re: Error when loading classifier

Post by Rund »

Thank you for the reply!

I used the railway_000033.laz file.

The classifier.yaml file is large (8,53 GB (9 160 938 366 bytes)). I will try to find a way to share it.
Is the size of the .yaml file as expected?
paul.leroy
Posts: 40
Joined: Tue Dec 01, 2020 1:21 pm

Re: Error when loading classifier

Post by paul.leroy »

Your yaml seems quite large.
What were your parameters in the training Dialog?
max depth
max tree count
active var count
min sample count
Rund
Posts: 8
Joined: Tue Aug 20, 2024 5:40 pm

Re: Error when loading classifier

Post by Rund »

I used the following settings,

Max depth: 25
Max tree count: 100
Active var count: 0
Min sample count: 10

Scales: 0.5:0.5:2
Attachments
3DMASC_SNCF_000033.PNG
3DMASC_SNCF_000033.PNG (133.33 KiB) Viewed 2842 times
paul.leroy
Posts: 40
Joined: Tue Dec 01, 2020 1:21 pm

Re: Error when loading classifier

Post by paul.leroy »

Please provide the initial parameter file.
Did you launch the training on the overall dataset at once?
Rund
Posts: 8
Joined: Tue Aug 20, 2024 5:40 pm

Re: Error when loading classifier

Post by Rund »

I launched the training on the railway_000033.laz file at once, without using a subset as core_points.

This is the initial parameter file,

# NAMES OF YOUR POINT CLOUDS
#cloud: PC1=railway_000033_rail.laz # Point cloud for training
cloud: PC1=
#cloud: corepoints=railway_000033_rail_sub04.laz

# CORE POINTS
#core_points: corepoints
core_points: PC1

# SCALES
scales: 0.5;1;1.5;2 # scales as a list

# FEATURES


feature: DIP_SCx_PC1
feature: DIPDIR_SCx_PC1
feature: PCA1_SCx_PC1
feature: PCA2_SCx_PC1
feature: PCA3_SCx_PC1
feature: SPHER_SCx_PC1
feature: ANISO_SCx_PC1
feature: LINEA_SCx_PC1
feature: PLANA_SCx_PC1
feature: Zmin_SCx_PC1
feature: Zmax_SCx_PC1
feature: ZRANGE_SCx_PC1
#feature: NORMDIP_SCx_MEDIAN_PC1

#We already calculated the verticality, you can ignore it if an error shows
#feature: VERT_SCx_MEDIAN_PC1
paul.leroy
Posts: 40
Joined: Tue Dec 01, 2020 1:21 pm

Re: Error when loading classifier

Post by paul.leroy »

I launched a training with the same parameter file and the same Random Trees dialog parameters. The classifier is quite large, about 700Mo, but not as much as yours. I can load it after to classify other points. Are you sure about your configuration?
Rund
Posts: 8
Joined: Tue Aug 20, 2024 5:40 pm

Re: Error when loading classifier

Post by Rund »

Ok, thank you very much. I really appreciate your help!

Regarding this,
Are you sure about your configuration?

Could you clarify? Do you mean if I installed CC and its dependencies correctly, or do you mean the 3DMASC settings/configuration?

Anyway, I will give it another try. Sounds like it would be useful to know if I can reproduce my issue.
paul.leroy
Posts: 40
Joined: Tue Dec 01, 2020 1:21 pm

Re: Error when loading classifier

Post by paul.leroy »

By configuration I meant 3DMASC settings. Yes, being able to reproduce the issue is mandatory.
Post Reply