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

Incorrect demo script #840

Open
IVarha opened this issue Feb 8, 2024 · 0 comments
Open

Incorrect demo script #840

IVarha opened this issue Feb 8, 2024 · 0 comments

Comments

@IVarha
Copy link

IVarha commented Feb 8, 2024

Hello, I am trying setup your demos, and test run of them and having several errors on code :

python demos/unpaired_ct_lung/demo_train.py

The training can also be launched using the following command.
deepreg_train --gpu '0' --config_path demos/unpaired_ct_lung/unpaired_ct_lung.yaml --log_dir demos/unpaired_ct_lung --exp_name logs_train
=======================================================






Traceback (most recent call last):
  File "demos/unpaired_ct_lung/demo_train.py", line 46, in <module>
    train(
TypeError: train() got an unexpected keyword argument 'exp_name'

further when I try this command

deepreg_train --gpu '0' --config_path demos/unpaired_ct_lung/unpaired_ct_lung.yaml --log_dir demos/unpaired_ct_lung --exp_name logs_train

deepreg_train: error: unrecognized arguments: --exp_name logs_train

when I removed --exp_name and do same run

Traceback (most recent call last):
  File "/usr/local/bin/deepreg_train", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/deepreg/train.py", line 242, in main
    train(
  File "/usr/local/lib/python3.8/dist-packages/deepreg/train.py", line 89, in train
    config, log_dir, ckpt_path = build_config(
  File "/usr/local/lib/python3.8/dist-packages/deepreg/train.py", line 44, in build_config
    config = config_parser.load_configs(config_path)
  File "/usr/local/lib/python3.8/dist-packages/deepreg/config/parser.py", line 45, in load_configs
    loaded_config = config_sanity_check(config)
  File "/usr/local/lib/python3.8/dist-packages/deepreg/config/parser.py", line 87, in config_sanity_check
    if data_config["format"] not in ["nifti", "h5"]:

the config is default

dataset:
  train:
    dir: demos/unpaired_ct_lung/dataset/train
    format: nifti
    labeled: true
  valid:
    dir: demos/unpaired_ct_lung/dataset/test
    format: nifti
    labeled: true
  test:
    dir: demos/unpaired_ct_lung/dataset/test
    format: nifti
    labeled: true
  type: unpaired # paired / unpaired / grouped
  image_shape: [96, 96, 104]
train:
  method: "ddf" # the registration method, value should be ddf / dvf / conditional
  backbone:
    name: "local" # value should be local / global / unet
    num_channel_initial: 32 # number of initial channel in local net, controls the size of the network
    extract_levels: [0, 1, 2, 3]
  loss:
    image:
      name: "ssd"
      weight: 2.0
    label:
      weight: 1.0
      name: "dice"
      scales: [0, 1, 2, 4, 8, 16]
    regularization:
      weight: 1.0
      name: "bending"
  preprocess:
    data_augmentation:
      name: "affine"
    batch_size: 4
    shuffle_buffer_num_batch: 1
  optimizer:
    name: "Adam"
    learning_rate: 1.0e-5
  epochs: 5000
  save_period: 500

my installed version is latest 0.1.2

Maybe it is worth to check.
Thank you

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

1 participant