Giter Club home page Giter Club logo

ieee_tpami_spectralgpt's Introduction

SpectralGPT: Spectral Remote Sensing Foundation Model

This is the official repository for the paper "SpectralGPT: Spectral Remote Sensing Foundation Model".

**IEEE TPAMI: (https://ieeexplore.ieee.org/document/10490262)

Danfeng Hong, Bing Zhang, Xuyang Li, Yuxuan Li, Chenyu Li, Jing Yao, Naoto Yokoya, Hao Li, Pedram Ghamisi, Xiuping Jia, Antonio Plaza, Paolo Gamba, Jon Atli Benediktsson, Jocelyn Chanussot

Abstract

The foundation model has recently garnered significant attention due to its potential to revolutionize the field of visual representation learning in a self-supervised manner. While most foundation models are tailored to effectively process RGB images for various visual tasks, there is a noticeable gap in research focused on spectral data, which offers valuable information for scene understanding, especially in remote sensing (RS) applications. To fill this gap, we created for the first time a universal RS foundation model, named SpectralGPT, which is purpose-built to handle spectral RS images using a novel 3D generative pretrained transformer (GPT). Compared to existing foundation models, SpectralGPT 1) accommodates input images with varying sizes, resolutions, time series, and regions in a progressive training fashion, enabling full utilization of extensive RS big data; 2) leverages 3D token generation for spatial-spectral coupling; 3) captures spectrally sequential patterns via multi-target reconstruction; 4) trains on one million spectral RS images, yielding models with over 600 million parameters. Our evaluation highlights significant performance improvements with pretrained SpectralGPT models, signifying substantial potential in advancing spectral RS big data applications within the field of geoscience across four downstream tasks: single/multi-label scene classification, semantic segmentation, and change detection.

Overview

alt text

Preparation

Install Python dependencies by running:

pip install -r requirements.txt

Training SpectralGPT

The pretraining experiments were run on 8 NVIDIA GeForce RTX 4090 GPUs.

Pretrain Dataset: fMoW-Sentinel & BigEarthNet

You can download the official fMoW-Sentinel dataset here. Try this link if the previous one doesn't display correctly.

You can download the official BigEarthNet dataset here.

Finetune Dataset: EuroSAT & OSCD & SegMunich

You can download the official EuroSAT dataset here for finetuning the pretrained model on classification tasks.

You can download the official OSCD dataset here for finetuning the pretrained model on change detection tasks.

You can download the official SegMunich dataset we collected here or here for finetuning the pretrained model on semantic segmentation tasks.

Dataset Use Link
fMoW-Sentinel pretrain download
BigEarthNet pretrain & finetune download
EuroSAT finetune download
OSCD finetune download
SegMunich finetune download

Pretraining

For pretraining on fMoW-Sentinel Dataset, this is the default command:

torchrun --nproc_per_node=8 main_pretrain.py \
--master_port=29501 \
--wandb spectralgpt_pretrain_stage1 \
--batch_size 16 --accum_iter 32 --blr 0.0002 \
--epochs 200 --warmup_epochs 20 --num_workers 16 \
--input_size 96 --patch_size 8 \
--mask_ratio 0.90 \
--model_type tensor \
--model mae_vit_base_patch8_96 \
--dataset_type sentinel --dropped_bands 10 \
--train_path .txt_file/train_result_demo.csv \
--output_dir .experiments/pretrain_fmow \
--log_dir .experiments/pretrain_fmow

For continual pretraining on BigEarthNet Dataset, this is the default command:

torchrun --nproc_per_node=8 main_pretrain.py \
--master_port=29502 \
--wandb spectralgpt_pretrain_stage2 \
--batch_size 16 --accum_iter 32 --blr 0.0001 \
--epochs 200 --warmup_epochs 20 --num_workers 16 \
--input_size 128 --patch_size 8 \
--mask_ratio 0.90 \
--model_type tensor \
--dataset_type bigearthnet \
--model mae_vit_base_patch8_128 \
--train_path .txt_file/bigearthnet_pretrain_result_demo.csv \
--resume_different_size .experiments/pretrain_fmow/checkpoint-199.pth \
--output_dir .experiments/pretrain_BEN \
--log_dir .experiments/pretrain_BEN

To resume a pretraining job, you can use --resume PATH/TO/CKPT.PTH (eg: --resume .experiments/pretrain/checkpoint-10.pth).

Finetuning

To finetune on EuroSAT, the basic command is:

torchrun --nproc_per_node=2 main_finetune.py \
--wandb eurosat_finetune \
--batch_size 16 --accum_iter 8 --blr 0.0002 \
--epochs 150 --num_workers 16 \
--input_size 128 --patch_size 8  \
--weight_decay 0.05 --drop_path 0.2 --reprob 0.25 --mixup 0.8 --cutmix 1.0 \
--model_type tensor \
--model vit_base_patch8_128 \
--dataset_type euro_sat --dropped_bands 10 \
--train_path .txt_file/train_euro_result.txt \
--test_path .txt_file/val_euro_result.txt \
--output_dir /home/experiments/finetune/eurosat \
--log_dir ./experiments/finetune/eurosat \
--finetune ./experiments/pretain/SpectralGPT+.pth

To finetune on BigEarthNet, please replace engine_finetune(line 44-45) with engine_finetune_BE(line 46-47) in the main_finetune.py, the basic command is:

torchrun --nproc_per_node=2 main_finetune.py \
--wandb bigearthnet_finetune \
--batch_size 16 --accum_iter 8 --blr 0.0002 \
--epochs 150 --num_workers 16 \
--input_size 128 --patch_size 8  \
--weight_decay 0.05 --drop_path 0.2 --reprob 0.25 --mixup 0.8 --cutmix 1.0 \
--model_type tensor \
--model mae_vit_base_patch8_128 \
--dataset_type euro_sat --dropped_bands 10 \
--train_path .txt_file/bigearthnet_train.txt \
--test_path .txt_file/bigearthnet_val.txt \
--output_dir /home/experiments/finetune/BEN \
--log_dir ./experiments/finetune/BEN \
--finetune ./experiments/pretain/SpectralGPT+.pth

We also released the codes of change detection on OSCD and semantic segmentation on SegMunich in the downstream_tasks folder. These codes are easy to use when paired with the correct data and checkpoint paths.

To finetune on OSCD dataset, the basic command is:

python train.py

To finetune on SegMunich dataset, the basic command is:

python -m torch.distributed.launch --nproc_per_node=2 \
--master_port=25643 --use_env train_multi_GPU_new.py

Model Weights

We have already uploaded our model checkpoints here. The SpectralGPT.pth checkpoint has been trained for 200 epochs on fMoW-Sentinel Dataset and the SpectralGPT+.pth has been continual pretrained on BigEarthNet Dataset for 100 epochs.

Model Checkpoint
SpectralGPT (200 epochs) download
SpectralGPT+ (100 epochs) download

Acknowledgements

Pretrain and downstream classification codes from this repository are inspired by the Masked Autoencoders (MAE) repository and SatMAE repository. The downstream pixel-level codes from this repository are inspired by Seasonal Contrast (SeCo) repository and Fully Convolutional Siamese Networks for Change Detection repository.

Citation

If you found our project helpful, please kindly cite our paper:

Danfeng Hong, Bing Zhang, Xuyang Li, Yuxuan Li, Chenyu Li, Jing Yao, Naoto Yokoya, Hao Li, Xiuping Jia, Antonio Plaza, Paolo Gamba, Jon Atli Benediktsson, Jocelyn Chanussot. SpectralGPT: Spectral remote sensing foundation model. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2024. DOI:10.1109/TPAMI.2024.3362475.

@article{hong2024spectralgpt,
  title={SpectralGPT: Spectral remote sensing foundation model},
  author={Hong, Danfeng and Zhang, Bing and Li, Xuyang and Li, Yuxuan and Li, Chenyu and Yao, Jing and Ghamisi, Pedram and Yokoya, Naoto and Li, Hao and Jia, Xiuping and Plaza, Antonio and others},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
  note={DOI:10.1109/TPAMI.2024.3362475},
  year={2024}
}

Licensing

Copyright (C) 2024 Danfeng Hong

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program.

Contact Information

Danfeng Hong: [email protected]
Danfeng Hong is with the Aerospace Information Research Institute, Chinese Academy of Sciences, 100094 Beijing, China.

ieee_tpami_spectralgpt's People

Contributors

danfenghong avatar

Stargazers

Chiru Ge avatar tui avatar  avatar Lorenzo Stacchio avatar  avatar TaoBingcheng avatar HaoyuWang avatar  avatar Thomson avatar Purin avatar  avatar  avatar Dong Yaxin avatar Jan Kněžík avatar lwdinWHU avatar  avatar  avatar  Sherlock Wang avatar Surya avatar Zelin Xu avatar  avatar  avatar  avatar hz avatar Bingze Song avatar Chuyi Zhou avatar Natthaphon Rotechanathamcharoen avatar Victor Martini avatar Julius Fricke avatar  avatar Lilin Tu avatar Iason Tsardanidis avatar Rikki Schulte avatar Siyuan Wang avatar Yuzeng Chen avatar  avatar  avatar  avatar frog avatar Jiameng Lv avatar  avatar  avatar Alexander Al-Feghali avatar Masanori Tani avatar DaiShaoqing avatar Jiang Kai avatar  avatar  avatar  avatar Jinhong Wu avatar Silvana avatar Tianlong Ai avatar Chamini Mirandu avatar  avatar  avatar Wenming Tu avatar Nome2s avatar Tarashish Mishra avatar  avatar Ryan Amaudruz avatar  avatar  avatar 尋に  avatar ParatrooperAndy avatar PLOWAN avatar  avatar 张梓浩 avatar Songxi avatar  avatar Retronyme avatar Shuguang Dou avatar Flipped avatar  avatar zhangjing avatar Matt Painter avatar ppjun avatar  avatar  avatar  avatar  avatar LuciusVorenus avatar  avatar Zijie Huo avatar Perseverance avatar haohao avatar Oneb1 avatar 不要葱姜蒜 avatar GH avatar  avatar Mingxi Zhang avatar Mukesh Rao avatar chirmy avatar AJ avatar Sezer Kutluk avatar  avatar Jieyi Tan avatar  avatar Alexandre Zouaoui avatar Caifa Zhou avatar DS.Xu avatar

Watchers

Thomas Ostersen avatar  avatar hiyyg avatar Pedro Li avatar  avatar

ieee_tpami_spectralgpt's Issues

img = np.concatenate((img,b,b), axis=2)

Please tell me, why does the TUM_128 file combine HIS with two "medium" b channels, and not with one? these are two identical layers.
the file TUM_128.py , line 96

How to Pretrain FMoW Data

Hello,
I'm trying to pretrain with the FMoW dataset (FMoW stands for 'Functional Map of the World - Sentinel-2 corresponding images').
By the way, if you execute the command below, the following results will be obtained.
If you encounter an error similar to mine, could you please tell me how to solve it?

(Note: There are two NVIDIA A100 80GB GPUs running on the server.)

Command

torchrun --nproc_per_node=1 main_pretrain.py \
--master_port=29501 \
--wandb spectralgpt_pretrain_stage1 \
--batch_size 1 --accum_iter 32 --blr 0.0002 \
--epochs 100 --warmup_epochs 20 --num_workers 2 \
--input_size 96 --patch_size 8 \
--mask_ratio 0.90 \
--model_type tensor \
--model mae_vit_base_patch8_96 \
--dataset_type sentinel --dropped_bands 10 \
--train_path .txt_file/train_result_demo.csv \
--output_dir .experiments/pretrain_fmow \
--log_dir .experiments/pretrain_fmow

Command Result

(sh_venv) jwjang@gpusystem:/home/jwjang/project/hsi/IEEE_TPAMI_SpectralGPT$ torchrun --nproc_per_node=1 main_pretrain.py \
--master_port=29501 \
--wandb spectralgpt_pretrain_stage1 \
--batch_size 1 --accum_iter 32 --blr 0.0002 \
--epochs 100 --warmup_epochs 20 --num_workers 2 \
--input_size 96 --patch_size 8 \
--mask_ratio 0.90 \
--model_type tensor \
--model mae_vit_base_patch8_96 \
--dataset_type sentinel --dropped_bands 10 \
--train_path .txt_file/train_result_demo.csv \
--output_dir .experiments/pretrain_fmow \
--log_dir .experiments/pretrain_fmow
usage: MAE pre-training [--batch_size BATCH_SIZE] [--epochs EPOCHS] [--accum_iter ACCUM_ITER]
                        [--model_type {group_c,tensor}] [--model MODEL] [--input_size INPUT_SIZE]
                        [--patch_size PATCH_SIZE] [--mask_ratio MASK_RATIO] [--spatial_mask]
                        [--norm_pix_loss] [--weight_decay WEIGHT_DECAY] [--lr LR] [--blr LR]
                        [--min_lr LR] [--warmup_epochs N] [--train_path TRAIN_PATH]
                        [--dataset_type {rgb,sentinel,euro_sat,bigearthnet}]
                        [--masked_bands MASKED_BANDS [MASKED_BANDS ...]]
                        [--dropped_bands DROPPED_BANDS [DROPPED_BANDS ...]]
                        [--grouped_bands GROUPED_BANDS [GROUPED_BANDS ...]]
                        [--output_dir OUTPUT_DIR] [--log_dir LOG_DIR] [--device DEVICE]
                        [--seed SEED] [--resume RESUME]
                        [--resume_different_size RESUME_DIFFERENT_SIZE] [--wandb WANDB]
                        [--start_epoch N] [--num_workers NUM_WORKERS] [--pin_mem] [--no_pin_mem]
                        [--world_size WORLD_SIZE] [--local-rank LOCAL_RANK] [--dist_on_itp]
                        [--dist_url DIST_URL]
MAE pre-training: error: unrecognized arguments: --master_port=29501
E0814 11:06:43.572000 132104842495104 torch/distributed/elastic/multiprocessing/api.py:826] failed (exitcode: 2) local_rank: 0 (pid: 3210449) of binary: /home/jwjang/project/hsi/IEEE_TPAMI_SpectralGPT/sh_venv/bin/python
Traceback (most recent call last):
  File "/home/jwjang/project/hsi/IEEE_TPAMI_SpectralGPT/sh_venv/bin/torchrun", line 8, in <module>
    sys.exit(main())
  File "/home/jwjang/project/hsi/IEEE_TPAMI_SpectralGPT/sh_venv/lib/python3.10/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 347, in wrapper
    return f(*args, **kwargs)
  File "/home/jwjang/project/hsi/IEEE_TPAMI_SpectralGPT/sh_venv/lib/python3.10/site-packages/torch/distributed/run.py", line 879, in main
    run(args)
  File "/home/jwjang/project/hsi/IEEE_TPAMI_SpectralGPT/sh_venv/lib/python3.10/site-packages/torch/distributed/run.py", line 870, in run
    elastic_launch(
  File "/home/jwjang/project/hsi/IEEE_TPAMI_SpectralGPT/sh_venv/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 132, in __call__
    return launch_agent(self._config, self._entrypoint, list(args))
  File "/home/jwjang/project/hsi/IEEE_TPAMI_SpectralGPT/sh_venv/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 263, in launch_agent
    raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError: 
============================================================
main_pretrain.py FAILED
------------------------------------------------------------
Failures:
  <NO_OTHER_FAILURES>
------------------------------------------------------------
Root Cause (first observed failure):
[0]:
  time      : 2024-08-14_11:06:43
  host      : gpusystem
  rank      : 0 (local_rank: 0)
  exitcode  : 2 (pid: 3210449)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
============================================================

Labels of SegMunich dataset

Hello! I want to know how the label values correspond to the specific categories in SegMunich dataset, since I have not found any descriptions in the code. I'm grateful if you could provide the correspondence like a dictionary.

Label values: ([0, 5, 11, 12, 13, 14, 21, 22, 23, 31, 32, 33, 41])
Categories: ([Background, Arable land, Permanent crops, Pastures, Forests, Surface water, Shrub, Open spaces, Wetlands, Mine dump, Artificial vegetation, Urban fabric, Buildings])

Spectral-to-Spectral Loss Code

您好,非常出色的工作。在查看您源代码的时候,在models_mae_spectral.py中,我并没有看到关于Spectral-to-Spectral的 LOSS 是如何实现的,仅看到了 loss1+loss3,应该是关于Token-to-Token的损失,并且看到一个未使用的计算光谱角的calculate_metrics_per_pixel函数,但是并没有在LOSS中看到使用,想请教一下Spectral-to-Spectral Loss 是如何实现的呢?

Hello, excellent work. When reviewing your source code in models_mae_spectral.py, I did not see how the Spectral-to-Spectral LOSS is implemented. I only saw loss1 + loss3, which seems to be related to Token-to-Token loss. I also noticed an unused calculate_metrics_per_pixel function for calculating the spectral angle, but it is not used in the LOSS. Could you please explain how the Spectral-to-Spectral Loss is implemented?

loss1 = (pred - target1) ** 2 # pred: 2,1024,192
loss1 = loss1.mean(dim=-1) # [N, L], mean loss per patch #2,1024
mask = mask.view(loss1.shape)
loss1 = (loss1 * mask).sum() / mask.sum()
loss3 = (pred_spatial - target_spatial) ** 2 # 2,4,192
loss3 = loss3.mean(dim=-1)
mask3 = torch.ones([N, h * w], device=loss3.device)
loss3 = (loss3 * mask3).sum() / mask3.sum()
loss = loss1 + loss3 # mean loss on removed patches
return loss

image
image

loss is nan :(

Hi, I changed the dataset to fMow-full with eight channels and wanted to perform pre-training again, but encountered a "loss is nan" issue at the 27th epoch. I also tried adding pre-trained weights with spectral.pth for training, but the "loss is nan" problem persists. I would like to inquire if such an issue occurs during your training process as well. If so, how do you resolve it? I would be extremely grateful if you could provide an answer.
This is my command:

torchrun --nproc_per_node=2 --master_port=29501 main_pretrain.py \
--wandb spectralgpt_pretrain_stage-full8 \
--batch_size 64 --accum_iter 32 --blr 0.0002 \
--epochs 200 --warmup_epochs 20 --num_workers 16 \
--input_size 96 --patch_size 8 \
--mask_ratio 0.90 \
--model_type tensor \
--model mae_vit_base_patch8_96 \
--dataset_type sentinel \
--train_path /data/DATASET/fMoW-full/train/8_channels_img.csv \
--output_dir /data/LXY/pretrain_fmow_full_spth+ \
--log_dir /data/LXY/pretrain_fmow_full_spth+

Inquiry about Model Layer Mismatch Issue

I'm using the SpectralGPT+ pre-trained model with the provided mae_vit_base_patch8_128 network architecture. While attempting to load pre-trained weights, I've encountered a mismatch between the layer names of SpectralGPT+ and mae_vit_base_patch8_128.

For instance, in the SpectralGPT+ model, the layer names are:
blocks.0.attn.q.weight
blocks.0.attn.q.bias
blocks.0.attn.k.weight
blocks.0.attn.k.bias
blocks.0.attn.v.weight
blocks.0.attn.v.bias

However, in the mae_vit_base_patch8_128 architecture, the corresponding layers are named:
blocks.0.attn.to_qkv.weight
blocks.0.attn.to_qkv.bias

Could you please advise on the correct way to map the pre-trained weights of SpectralGPT+ to the mae_vit_base_patch8_128 model? Any suggestions or insights would be greatly appreciated.

Thank you for your assistance!

Hard coded wandb entity

This is raising an error:

    wandb.init(project=args.wandb, entity="mae-sentinel")
[12:30:03.910893]   File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/wandb/sdk/wandb_init.py", line 1144, in init
wandb: ERROR It appears that you do not have permission to access the requested resource.

This should probably be passed in too

What is the Python version of the environmet?

Great work! I am trying to run this code for pretraining. I can't find a compatible Python version for the requirements.txt. What is the Python version for the experiment? Thanks:)

Hyperspectral image

Can the pre-trained weights of SpectralGPT be used for semantic segmentation tasks on hyperspectral images?
Can SpectralGPT, which is trained on multispectral images (10+ spectral bands), be applied to downstream tasks on hyperspectral images (100+ spectral bands)?

For --model mae_vit_base_patch8_128, KeyError

Running eurosat_finetune, from the error:

    model = models_vit_tensor.__dict__[args.model](drop_path_rate=args.drop_path,
KeyError: 'mae_vit_base_patch8_128'

Adding print(list(models_vit_tensor.__dict__.keys()) I see:

['__name__', '__doc__', '__package__', '__loader__', '__spec__', '__file__', '__cached__', '__builtins__', 'partial', 'torch', 'nn', 

'Attention', 'Block', 'PatchEmbed', 'Linear_Block', 'Linear_Attention', 'VisionTransformer', 'vit_huge_patch14', 'vit_base_patch16', 

'vit_base_patch8', 'vit_base_patch8_128', 'vit_base_patch8_channel10', 'vit_base_patch16_128', 'vit_large_patch16', 

'vit_large_patch8_128', 'vit_huge_patch8_128', 'vit_base_patch8_120']

Possibly missing from the script: import models_mae_spectral and at line 273: model = models_mae_spectral.__dict__[args.model]()
However I then get AttributeError: 'MaskedAutoencoderViT' object has no attribute 'head'

pre-trained weights, SegMunich dataset

Hello, could you make publicly available the pre-prepared weights of the model that was trained on SegMunich data for the semantic segmentation task, please?

drone images

Hello, if we are using 5-channel drone images for fine-tuning, what content would generally need to be modified?

Standardise number of GPU Used?

From the paper 4 NVIDIA GeForce RTX 4090 GPUs, are used. However for Eurosat script --nproc_per_node=2 - I have a machine with 4GPU but setting --nproc_per_node=4 resulted in an error (RuntimeError: CUDA error: invalid device ordinal). I propose to standardise on 4 GPU, or documenting how to adjust the GPU usage

There are issues with the SegMunich code for downstream tasks

In the relevant code of SegMunich, there is a file called train_rulti_GPU_new.cpy, which has a parameter of num classes to determine the number of classes. When the model was just created, num classes were indeed passed in as parameters. The source code is: model=creat_madel (nb_classes=num_classes, weight_path=pretrain_path, pretrain=True), But in fact, model=vit_dase-patch8 (num_classes=nb_classes) was called in the creat_madel function. After going deeper layer by layer, the final code is: model=VisionTransformer(
img_size=128,
in_chans=1,
patch_size=8,
embed_dim=768,
depth=12,
num_heads=12,
mlp_ratio=4,
num_frames=12,
t_patch_size=3,
norm_layer=partial(nn. LayerNorm, eps=1e-6),
**kwargs,
)
Find the location of the model definition. There is a parameter of num_classes=10, which is the num-class we initially passed in. However, in reality, this parameter has not been used, and the model has been written to 13 instead of num-class. The source code is self. cls_sg=nn Sequential(
nn.Conv2d(256, 13, kernel_size=3, padding=1),
)
The correct answer should be: self. cls_sg=nn Sequential(
nn.Conv2d(256, num_classes, kernel_size=3, padding=1),
)

Document dataset location requirement

Eurosat - data expected in data/tif. It would be preferable to pass in this location, and then the dataset could be simply downloaded with torchgeo and the location referenced. This is achieved with:

from torchgeo.datasets import OSCD
train_ds = OSCD(download=True, checksum=False)

Attention Heads in VisionTransformer

Hello, impressive work.

I am trying to run inference on the models inspired on the code found in main_finetune.py.

I am trying to load the model as such:
model = models_vit.dict["vit_base_patch16"](
patch_size=patch_size, img_size=input_size, in_chans=in_c,
num_classes=nb_classes, drop_path_rate=drop_path, global_pool=global_pool,
)

Still, when trying to load the model I keep getting an error:
AttributeError: 'VisionTransformer' object has no attribute 'attention_heads'

I guess the culprit is in line 29 in the models_vit.py file.
---> [29] self.attn_bias = get_alibi(attention_heads=self.attention_heads,
[30] num_patches=self.num_patches)

I cant find any reference to this self.attention_heads anywhere. Did you mean self.num_heads that are the ones used by attention?

Model Inference

Hello, thank you for your work. How can I inference your pretrained model? For example, I want to make inferences in this model with my Sentinel-2 images.

UperNet

Hello, why do you use "UperNet" in a segmentation task if there is a classification layer at the end of "SpectralGPT"?

SegMunich dataset

Hello, which mean and std did you use to experiment with SegMunich data?
this dictionary is initialized on line 14 in the file
TUM_128.py

mean_std_dict = { 'SegMunich': ['SegMunich', ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.