VSainteuf / utae-paps

PyTorch implementation of U-TAE and PaPs for satellite image time series panoptic segmentation.

Repository from Github https://github.comVSainteuf/utae-papsRepository from Github https://github.comVSainteuf/utae-paps

[missing input argment]

GustavoMourao opened this issue · comments

parser.add_argument(

Please, add:

parser.add_argument(
    "--model",
    default="utae",
    type=str,
    help="Type of architecture to use. Can be one of: (utae/unet3d/fpn/convlstm/convgru/uconvlstm/buconvlstm)",
)

Since we'll get this error:

AttributeError: 'Namespace' object has no attribute 'model'

However, after this, the code is fixed. However, I'm getting this error message:

RuntimeError: Error(s) in loading state_dict for UTAE:
        Missing key(s) in state_dict: "in_conv.conv.conv.0.weight", "in_conv.conv.conv.0.bias", "in_conv.conv.conv.1.weight", "in_conv.conv.conv.1.bias", "in_conv.conv.conv.3.weight", "in_conv.conv.conv.3.bias", "in_conv.conv.conv.4.weight",...

@VSainteuf , please, at script test_semantic.py, also add:

  • parser.add_argument("--ignore_index", default=-1, type=int)

Its missing this parser, as well

I have found why this behavior is occurring:

RuntimeError: Error(s) in loading state_dict for UTAE:
        Missing key(s) in state_dict: "in_conv.conv.conv.0.weight", "in_conv.conv.conv.0.bias", "in_conv.conv.conv.1.weight", "in_conv.conv.conv.1.bias", "in_conv.conv.conv.3.weight", "in_conv.conv.conv.3.bias", "in_conv.conv.conv.4.weight",...

Since this condition:

            if (
                epoch > config.warmup
                and epoch % config.val_every == 0
                and epoch > config.val_after
            ):

those parameters have to follow this statement (why?):

 !python utae-paps/train_panoptic.py \
  --fold 2 \
  --batch_size 2 \
  --epochs 10 \
  --dataset_folder PASTIS/ \
  --res_dir OUT_DIR \
  --device cuda \
  --val_after 5 \
  --val_every 5

Hi @GustavoMourao,
I do not have the same errors for the test_semantic.py script as you.
Did you maybe alter the conf.json file in the model weights folder ? This json stores the configuration used for training, and a lot of variables in test_semantic.py are set based on this file. That would explain the bugs you observed.