xinge008 / Cylinder3D

Rank 1st in the leaderboard of SemanticKITTI semantic segmentation (both single-scan and multi-scan) (Nov. 2020) (CVPR2021 Oral)
Apache License 2.0
856 stars 180 forks source link

run `train_cylinder_asym.py` error #13

Closed lisilin013 closed 3 years ago

lisilin013 commented 3 years ago

Thanks for your great work! When I run train.sh to infer the semantic kitti dataset, the following error is occured.

$ ./train.sh
Traceback (most recent call last):
  File "train_cylinder_asym.py", line 16, in <module>
    from dataloader.pc_dataset import get_SemKITTI_label_name
  File "/home/nrsl/Cylinder3D/dataloader/pc_dataset.py", line 18
    assert name not in REGISTERED_PC_DATASET_CLASSES, f"exist class: {REGISTERED_PC_DATASET_CLASSES}"
                                                                                                    ^
SyntaxError: invalid syntax
xinge008 commented 3 years ago

@lisilin013 do you modify the semantickitti.yaml? I can not reproduce your error when running the codebase without modification.

lisilin013 commented 3 years ago

I modified the dataset path and make a new dir model_save_dir then move the mode download from LINK1 to model_save_dir.

image

image

xinge008 commented 3 years ago

How about these dataset_params, can you show them.

From the log, it seems there exist some syntax errors in the config file. It's better to show them all.

lisilin013 commented 3 years ago

Git diff results is shown as the following picture: image

The complete params are listed as follows:

# Config format schema number
format_version: 4

###################
## Model options
model_params:
  model_architecture: "cylinder_asym"

  output_shape:
    - 480
    - 360
    - 32

  fea_dim: 9
  out_fea_dim: 256
  num_class: 20
  num_input_features: 16
  use_norm: True
  init_size: 32

###################
## Dataset options
dataset_params:
  dataset_type: "cylinder_dataset"
  pc_dataset_type: "SemKITTI_sk"
  ignore_label: 0
  return_test: False
  fixed_volume_space: True
  label_mapping: "./config/label_mapping/semantic-kitti.yaml"
  max_volume_space:
    - 50
    - 3.1415926
    - 2
  min_volume_space:
    - 0
    - -3.1415926
    - -4

###################
## Data_loader options
train_data_loader:
  data_path: "/media/nrsl/software/dataset/semantic_kitti/dataset"
  imageset: "train"
  return_ref: True
  batch_size: 2
  shuffle: True
  num_workers: 4

val_data_loader:
  data_path: "/media/nrsl/software/dataset/semantic_kitti/dataset"
  imageset: "val"
  return_ref: True
  batch_size: 1
  shuffle: False
  num_workers: 4

###################
## Train params
train_params:
  model_load_path: "./model_load_dir/model_load.pt"
  model_save_path: "./model_save_dir/model_save.pt"
  checkpoint_every_n_steps: 4599
  max_num_epochs: 40
  eval_every_n_steps: 4599
  learning_rate: 0.001
xinge008 commented 3 years ago

The config looks good.

How about the pc_dataset.py? Do you have any modification.

lisilin013 commented 3 years ago

No, I didn't change any files except the config file. I just download this repo again, and just modify the config file. The problem is reproduced as before. It was wired.

xinge008 commented 3 years ago

In my opinion, there are two possible reasons, 1) the environmental setting, especially the version of pyyaml, pytorch, spconv, etc. 2) there exists some typos.

I just download the code and modify the config file. No error incurs and it works well.

xinge008 commented 3 years ago

Reopen if there is further information