-
Notifications
You must be signed in to change notification settings - Fork 40
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
Running inference on prithvi EO v2 models fails with terratorch predict ...
#438
Comments
@paolofraccaro suggested to use this function to resize and pad the image to be ready for the model. |
With @romeokienzler suggestion.
Config filedata: class_path: terratorch.datamodules.GenericNonGeoSegmentationDataModule init_args: allow_substring_split_file: true batch_size: 4 constant_scale: 1.0 dataset_bands: - 2 - 1 - 0 - 3 - 4 - 5 drop_last: true expand_temporal_dimension: false ignore_split_file_extensions: true img_grep: '*_S2GeodnHand.tif' label_grep: '*_LabelHand.tif' means: - 0.12520133 - 0.13471393 - 0.107582 - 0.3236181 - 0.2341743 - 0.15878009 no_data_replace: 0.0 no_label_replace: -1 num_classes: 2 num_workers: 2 output_bands: - 2 - 1 - 0 - 3 - 4 - 5 pin_memory: false reduce_zero_label: false rgb_indices: - 2 - 1 - 0 stds: - 0.07323416 - 0.06783548 - 0.07145836 - 0.09489725 - 0.07938496 - 0.07089546 test_data_root: /data/geodata-dbce399c854511efb3260a580a830dad/training_data test_label_data_root: /data/geodata-dbce399c854511efb3260a580a830dad/labels test_split: /data/geodata-dbce399c854511efb3260a580a830dad/split_files/test_data.txt test_transform: - class_path: albumentations.Resize init_args: always_apply: false height: 512 interpolation: 1 p: 1.0 width: 512 - class_path: albumentations.pytorch.ToTensorV2 init_args: always_apply: true p: 1.0 transpose_mask: false train_data_root: /data/geodata-dbce399c854511efb3260a580a830dad/training_data train_label_data_root: /data/geodata-dbce399c854511efb3260a580a830dad/labels train_split: /data/geodata-dbce399c854511efb3260a580a830dad/split_files/train_data.txt train_transform: - class_path: albumentations.Resize init_args: always_apply: false height: 512 interpolation: 1 p: 1.0 width: 512 - class_path: albumentations.RandomCrop init_args: always_apply: false height: 224 p: 1.0 width: 224 - class_path: albumentations.HorizontalFlip init_args: always_apply: false p: 0.5 - class_path: albumentations.VerticalFlip init_args: always_apply: false p: 0.5 - class_path: albumentations.pytorch.ToTensorV2 init_args: always_apply: true p: 1.0 transpose_mask: false val_data_root: /data/geodata-dbce399c854511efb3260a580a830dad/training_data val_label_data_root: /data/geodata-dbce399c854511efb3260a580a830dad/labels val_split: /data/geodata-dbce399c854511efb3260a580a830dad/split_files/val_data.txt val_transform: - class_path: albumentations.Resize init_args: always_apply: false height: 512 interpolation: 1 p: 1.0 width: 512 - class_path: albumentations.pytorch.ToTensorV2 init_args: always_apply: true p: 1.0 transpose_mask: false deploy_config_file: true model: class_path: terratorch.tasks.SemanticSegmentationTask init_args: freeze_backbone: false freeze_decoder: false freeze_head: false ignore_index: -1 loss: ce lr: 0.001 model_args: backbone: prithvi_eo_v2_300 backbone_bands: - BLUE - GREEN - RED - NIR_NARROW - SWIR_1 - SWIR_2 backbone_pretrained: false decoder: UperNetDecoder decoder_channels: 256 decoder_scale_modules: true head_dropout: 0.1 necks: - indices: - 5 - 11 - 17 - 23 name: SelectIndices - name: ReshapeTokensToImage - name: LearnedInterpolateToPyramidal num_classes: 2 rescale: true model_factory: EncoderDecoderFactory output_most_probable: true plot_on_val: 10 out_dtype: int16 seed_everything: 0 trainer: accelerator: auto accumulate_grad_batches: 1 barebones: false check_val_every_n_epoch: 1 detect_anomaly: false devices: auto enable_checkpointing: true fast_dev_run: false inference_mode: true log_every_n_steps: 10 logger: false max_epochs: 2 max_steps: -1 num_nodes: 1 overfit_batches: 0.0 precision: 16-mixed reload_dataloaders_every_n_epochs: 0 strategy: auto sync_batchnorm: false use_distributed_sampler: true I get this error
Box folder with artifacts: https://ibm.box.com/s/4nrf2jsfskjp5sbjg0ltrm5mh62f0pks |
With @paolofraccaro recomendation I get this error:
|
Is there an updated I have checked the floods and burnscars hugging face repos, but nothing is there. |
HI, @WanjiruCate I saw the issue happens in the function
I understand that it isn't always true. |
@WanjiruCate
It runs, but I got a black image as output. |
Describe the issue
Running inference with a finetuned model using the cli fails using an image downloaded using geostudio.
To Reproduce (optional, but appreciated)
Steps to reproduce the behavior:
Screenshots or log output (optional)
If applicable, add screenshots or log output to help explain your problem.
Log Output
Expected behavior (optional)
Prediction to happen seamlessly
Deployment information (optional)
Describe what you've deployed and how:
git+https://git@github.com/IBM/terratorch.git@1fa07cd806
pip install git+https://git@github.com/IBM/terratorch.git@1fa07cd806
The text was updated successfully, but these errors were encountered: