Tlt-train classification error

Hi,

I am trying to train the resnet34 model on a classification task and I am getting this error:

ValueError: Error when checking target: expected predictions to have shape (176,) but got array with shape (2,)

My config file is:

model_config {

arch: “resnet”
n_layers: 34
use_bias: True
use_batch_norm: True
all_projections: True
use_pooling: False
freeze_bn: False
freeze_blocks: 0
freeze_blocks: 1

input_image_size: “3,224,224”
}

eval_config {
eval_dataset_path: “/workspace/nvidia_experiment/dataset-man-woman/test”
model_path: “/workspace/nvidia_experiment/tlt_pretrained_classification_vresnet34/resnet_34.hdf5”
top_k: 3
#conf_threshold: 0.5
batch_size: 2
n_workers: 8

}

train_config {
train_dataset_path: “/workspace/nvidia_experiment/dataset-man-woman/train”
val_dataset_path: “/workspace/nvidia_experiment/dataset-man-woman/val”
pretrained_model_path: “/workspace/nvidia_experiment/tlt_pretrained_classification_vresnet34/resnet_34.hdf5”

optimizer: “sgd”
batch_size_per_gpu: 2
n_epochs: 80
n_workers: 16

reg_config {
type: “L2”
scope: “Conv2D,Dense”
weight_decay: 0.00005

}

lr_config {

scheduler: "soft_anneal"
learning_rate: 0.005
soft_start: 0.056
annealing_points: "0.3, 0.6, 0.8"
annealing_divider: 10

}
}

Please advice!

1 Like

It seems that if I set ‘use_bias: False’ it works.

Could you throw some light on this option please?

Thanks!

use_bias: Boolean, whether the layer uses a bias vector.

By default, it is False.

Thanks.

I am not sure why this is impacting the 'input_image_size" and the error (related to the number of classes in the final ‘predictions’ layer.

When I set ‘use_bias: True’ i get the error I mentioned in my first post above.

I will check it.

Please go ahead with ‘use_bias: False’.
Tlt team will fix it in future release.

1 Like

Got it. Thanks