Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error after latest git pull (main branch)

See original GitHub issue

getting this error while launching a training script which was previously working (with the same configuration file):

Traceback (most recent call last):
  File "demos/paired_MMIV/", line 29, in <module>
  File "/home/charlie/3DREG-tests/DeepReg/deepreg/", line 94, in train
  File "/home/charlie/3DREG-tests/DeepReg/deepreg/", line 45, in build_config
    config = config_parser.load_configs(config_path)
  File "/home/charlie/3DREG-tests/DeepReg/deepreg/", line 41, in load_configs
  File "/home/charlie/3DREG-tests/DeepReg/deepreg/", line 90, in config_sanity_check
    if config["train"]["method"] == "conditional":
KeyError: 'method'

the script is

from deepreg.train import train
import sys

######## TRAINING ########

gpu = "2,3"
gpu_allow_growth = True
log_dir = "paired_logs_train"

config_path = [

if len(sys.argv) != 2:
    print('using training log dir ', log_dir)
    log_dir = "paired_logs_train_"+sys.argv[1]
    print('using training log dir ', log_dir)

#ckpt_path = "logs/paired_logs_train_10000epochs_gmi_unet_lw1rw1_learnrate1e-5/save/weights-epoch10000.ckpt" # restart from saved model
ckpt_path = ""


the config file I use

    method: "ddf" # ddf / dvf / conditional
    backbone: "unet" # options include "local", "unet" and "global" - use "global" when method=="affine"
      num_channel_initial: 4 # 4
      extract_levels: [0, 1, 2, 3] # [0, 1, 2, 3]
      num_channel_initial: 16
      depth: 3 # original 3
      pooling: true
      concat_skip: true

        name: "gmi"  # "lncc" (local normalised cross correlation), "ssd" (sum of squared distance) and "gmi" (differentiable global mutual information loss via Parzen windowing method)
        weight: 1.0
        weight: 0.0
        name: "multi_scale"
          loss_type: "dice" # options include "dice", "cross-entropy", "mean-squared", "generalised_dice" and "jaccard"
          loss_scales: [0, 1, 2, 4, 8, 16]
      weight: 1.0
      energy_type: "gradient-l2" # "bending" # options include "bending", "gradient-l1" and "gradient-l2"

    batch_size: 2 #original 2
    shuffle_buffer_num_batch: 1

    name: "adam"
      learning_rate: 1.0e-5 #1.0e-2 bad
      learning_rate: 1.0e-4
      momentum: 0.9
      learning_rate: 1.0e-4
      momentum: 0.9

  epochs: 10000
  save_period: 500

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:41 (20 by maintainers)

github_iconTop GitHub Comments

ciphercharlycommented, Jan 24, 2021

🤦 I had picked the wrong ones ofc, the indexes are 0,1,2,3 and I was assuming 1,2,3,4 without thinking… it’s running on 2 GPUs with batch_size 2 now and no errors

ciphercharlycommented, Jan 24, 2021

ok I checked with nvidia-smi to pick the most free ones but it may just be that there’s not enough free memory available right now, thanks a lot for the check!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when running git pull origin master - Stack Overflow
It would appear that you have the file nbproject/private/rake-d. txt in your local repository, but not tracked by git. Meanwhile, it has been...
Read more >
Git - Pull Not Working - Unfuddle Support
As the error message states: you will have to let Git know what remote branch it should use to track with the current...
Read more >
Git Tutorial: How to Fix 18 Common Mistakes - Creative Tim
Before starting to create a new branch, make sure that your master/main is updated with the latest changes: $ git pull. After the...
Read more >
Git pull fails - Unable to resolve reference refs/remotes/origin ...
Accepted Answer - 1 ... To fix this error, remove the following file YOURPROJECT/.git/refs/remotes/origin/master , and then run git fetch to download it...
Read more >
How do I force git pull to overwrite local files? - Tower Git Client
The reason for error messages like these is rather simple: you have local changes that would be overwritten by the incoming new changes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found