Comments (2)
That seemed to have worked with that input
/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_token.py:88: UserWarning:
The secret HF_TOKEN
does not exist in your Colab secrets.
To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.
You will be able to reuse this secret in all of your notebooks.
Please note that authentication is recommended but still optional to access public models or datasets.
warnings.warn(
config.json: 100%
70.0k/70.0k [00:00<00:00, 3.79MB/s]
pytorch_model.bin: 100%
22.5M/22.5M [00:00<00:00, 201MB/s]
Some weights of MobileViTForSemanticSegmentation were not initialized from the model checkpoint at apple/mobilevit-small and are newly initialized: ['segmentation_head.aspp.convs.0.convolution.weight', 'segmentation_head.aspp.convs.0.normalization.bias', 'segmentation_head.aspp.convs.0.normalization.num_batches_tracked', 'segmentation_head.aspp.convs.0.normalization.running_mean', 'segmentation_head.aspp.convs.0.normalization.running_var', 'segmentation_head.aspp.convs.0.normalization.weight', 'segmentation_head.aspp.convs.1.convolution.weight', 'segmentation_head.aspp.convs.1.normalization.bias', 'segmentation_head.aspp.convs.1.normalization.num_batches_tracked', 'segmentation_head.aspp.convs.1.normalization.running_mean', 'segmentation_head.aspp.convs.1.normalization.running_var', 'segmentation_head.aspp.convs.1.normalization.weight', 'segmentation_head.aspp.convs.2.convolution.weight', 'segmentation_head.aspp.convs.2.normalization.bias', 'segmentation_head.aspp.convs.2.normalization.num_batches_tracked', 'segmentation_head.aspp.convs.2.normalization.running_mean', 'segmentation_head.aspp.convs.2.normalization.running_var', 'segmentation_head.aspp.convs.2.normalization.weight', 'segmentation_head.aspp.convs.3.convolution.weight', 'segmentation_head.aspp.convs.3.normalization.bias', 'segmentation_head.aspp.convs.3.normalization.num_batches_tracked', 'segmentation_head.aspp.convs.3.normalization.running_mean', 'segmentation_head.aspp.convs.3.normalization.running_var', 'segmentation_head.aspp.convs.3.normalization.weight', 'segmentation_head.aspp.convs.4.conv_1x1.convolution.weight', 'segmentation_head.aspp.convs.4.conv_1x1.normalization.bias', 'segmentation_head.aspp.convs.4.conv_1x1.normalization.num_batches_tracked', 'segmentation_head.aspp.convs.4.conv_1x1.normalization.running_mean', 'segmentation_head.aspp.convs.4.conv_1x1.normalization.running_var', 'segmentation_head.aspp.convs.4.conv_1x1.normalization.weight', 'segmentation_head.aspp.project.convolution.weight', 'segmentation_head.aspp.project.normalization.bias', 'segmentation_head.aspp.project.normalization.num_batches_tracked', 'segmentation_head.aspp.project.normalization.running_mean', 'segmentation_head.aspp.project.normalization.running_var', 'segmentation_head.aspp.project.normalization.weight', 'segmentation_head.classifier.convolution.bias', 'segmentation_head.classifier.convolution.weight']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
odict_keys(['loss', 'logits'])
from transformers.
Hi @travisddavies, can you please specify what is going wrong or provide an error traceback?
I was able to run the following code
import numpy as np
from transformers import MobileViTImageProcessor, MobileViTForSemanticSegmentation
image = np.ones((512, 512, 3), dtype=np.uint8)
mask = np.ones((512, 512), dtype=np.uint8)
image_processor = MobileViTImageProcessor(do_reduce_labels=False)
id2label = {
0: "background",
1: "object",
}
label2id = {v: k for k, v in id2label.items()}
model = MobileViTForSemanticSegmentation.from_pretrained(
"apple/mobilevit-small",
num_labels=2,
id2label=id2label,
label2id=label2id)
# for training mode we need batch size > 1 for batch norm layer, duplicate image and mask
inputs = image_processor(images=[image, image], segmentation_maps=[mask, mask], return_tensors="pt")
model.train()
outputs = model(pixel_values=inputs["pixel_values"], labels=inputs['labels'])
print(outputs.keys())
# >>> odict_keys(['loss', 'logits'])
from transformers.
Related Issues (20)
- Sigmoid instead of softmax used in Documentation and autopipeline for siglip HOT 8
- AutoModel not loading model correctly due to config_class inconsistency HOT 7
- Llama-2 output from the forward function is nonsense. Output from `.generate()` is okay HOT 2
- GenerationConfig throws Object is not JSON serializable when setting constraints HOT 3
- from transformers import Phi3VModel, Phi3VConfig. Phi3 Vision config not added to transformers. HOT 1
- Add ability to specify input device for ffmpeg_microphone() HOT 1
- Slow tokenizer not loading mixtral 8x22b tokenizer correctly HOT 1
- Multi input of owlv2 cause RuntimeError: Boolean value of Tensor with more than one value is ambiguous HOT 2
- Log multiple losses used along with the combined losses when a model returns a dictionary of losses.
- get_wsd_schedule gets passed num_training_steps because not handled HOT 1
- rework `test_multi_gpu_data_parallel_forward`
- Convert_mistral_weights_to_hf fails loading consolidated.safetensors HOT 3
- Caching Past Key values of any length for Vision LLM's HOT 2
- LLAMA3's special_token is not the same in a file as it is used HOT 1
- Pre-training reference URL in Idefics2 codebase HOT 4
- Add HelpingAIForCausalLM to it HOT 7
- NotImplementedError: Cannot copy out of meta tensor; no data! HOT 2
- need better token_type_id processing on transformer GPT2Model HOT 3
- OverflowError: out of range integral type conversion attempted HOT 4
- TypeError: Cannot convert [array([322., 1.])] to EagerTensor of dtype int64
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transformers.