Comments (3)
或者说,有什么办法能直只下载ChineseCLIP的image encoder。
我可以只针对image endcoder 进行微调
from chinese-clip.
好像是tokenizer的问题,换成AutoProcessor好使了
from chinese-clip.
from PIL import Image
import requests
from transformers import CLIPProcessor, ChineseCLIPVisionModel, AutoProcessor
model = ChineseCLIPVisionModel.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")
processor = AutoProcessor.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")
url = "https://clip-cn-beijing.oss-cn-beijing.aliyuncs.com/pokemon.jpeg"
image = Image.open(requests.get(url, stream=True).raw)
inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)
last_hidden_state = outputs.last_hidden_state
pooled_output = outputs.pooler_output # pooled CLS states
print(len(pooled_output))
from chinese-clip.
Related Issues (20)
- 请问分词器有没有c++版本的实现? HOT 2
- 请问训练脚本会在当验证集上性能下降时停止训练吗,还是说只是会汇报下验证集上的性能但训练继续 HOT 1
- load_from_name 加入 flash-attn 支持 HOT 4
- 转换模型格式时的config.json文件是要自己提供吗
- 这个可以在华为的服务器部署吗? HOT 1
- 执行bash run_scripts/muge_finetune_vit-b-16_rbt-base.sh /home/liujiawei/datapath报错 HOT 3
- 请问有开源Chinese-Clip-Vit-G的计划么
- 请问在实现image caption上有什么建议吗
- fine tune报线程错误 求指导 HOT 3
- 1
- 模型finetune这部操作应该使用什么软件?请各位大佬回复 HOT 2
- 想要验证Flickr30K-CN Retrieval数据集应该使用那个脚本?
- ViT-H/14训练脚本、部署能够提供吗?(使用ViT-B/16更改为ViT-H/14脚本,训练起来,模型各个方面参数都是下降的,但是部署成tensorRT,用图片预测,效果堪忧) HOT 2
- 手动修改ChineseCLIPVisionModel to ChineseCLIPVisionModelWithProjection 失败。 HOT 1
- how to continue training with self-data? or Full Parameter Fine-Tuning HOT 1
- Question: gradient accumulate
- 各位大佬,专家,请问该模型能否在Windows系统下进行运行呢?欢迎来交流
- onnx模型转换报错
- “参数命名不同”:Huggingface上的CLIP模型和GITHUB上的 CLIP模型 参数命名不同
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 chinese-clip.