yangjianxin1 / clip-chinese Goto Github PK
View Code? Open in Web Editor NEW中文CLIP预训练模型
中文CLIP预训练模型
你好,请问有预训练好的原始的ckpt权重吗?
您好!我想用您的模型来对本地数据集进行图文相似度计算。请问是否需要进行微调呢?谢谢!
你好,我遇到了没有cuda的问题
在windows后台运行:python train_clip.py --train_args_file train_args/train_clip.json
报错
Traceback (most recent call last):
File "train_clip.py", line 136, in
main()
File "train_clip.py", line 86, in main
args, training_args = parser.parse_json_file(json_file=train_args_file)
File "E:\ancanda\envs\CLIP-Chinese\lib\site-packages\transformers\hf_argparser.py", line 392, in parse_json_file
outputs = self.parse_dict(data, allow_extra_keys=allow_extra_keys)
File "E:\ancanda\envs\CLIP-Chinese\lib\site-packages\transformers\hf_argparser.py", line 367, in parse_dict
obj = dtype(**inputs)
File "", line 105, in init
File "E:\ancanda\envs\CLIP-Chinese\lib\site-packages\transformers\training_args.py", line 1133, in post_init
raise ValueError(
ValueError: FP16 Mixed precision training with AMP or APEX (--fp16
) and FP16 half precision evaluation (--fp16_full_eval
) can only be used on CUDA devices.
cuda版本是12.4
(CLIP-Chinese) F:\python\CLIP-Chinese>nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Tue_Feb_27_16:28:36_Pacific_Standard_Time_2024
Cuda compilation tools, release 12.4, V12.4.99
Build cuda_12.4.r12.4/compiler.33961263_0
是版本不兼容吗?
I am a beginner in natural language processing.
When I clone the repository, install the environment dependencies, and try to run the quickstart code in README, the following error occurs, how should I solve it?
my python version is 3.8.15, other dependencies have the same version as the requirements.txt
Traceback (most recent call last):
File "quickstart.py", line 15, in <module>
inputs = processor(text=["一只小狗在摇尾巴", "一只小猪在吃饭"], images=image, return_tensors="pt", padding=True)
File "/home/liuzhiming/.miniconda3/envs/clip-chinese/lib/python3.8/site-packages/transformers/models/clip/processing_clip.py", line 85, in __call__
image_features = self.feature_extractor(images, return_tensors=return_tensors, **kwargs)
File "/home/liuzhiming/.miniconda3/envs/clip-chinese/lib/python3.8/site-packages/transformers/models/clip/feature_extraction_clip.py", line 146, in __call__
images = [self.resize(image=image, size=self.size, resample=self.resample) for image in images]
File "/home/liuzhiming/.miniconda3/envs/clip-chinese/lib/python3.8/site-packages/transformers/models/clip/feature_extraction_clip.py", line 146, in <listcomp>
images = [self.resize(image=image, size=self.size, resample=self.resample) for image in images]
File "/home/liuzhiming/.miniconda3/envs/clip-chinese/lib/python3.8/site-packages/transformers/models/clip/feature_extraction_clip.py", line 207, in resize
new_short, new_long = size, int(size * long / short)
TypeError: unsupported operand type(s) for *: 'dict' and 'int'
I tried to output the values of several parameters in transformers/models/clip/feature_extraction_clip.py", line 207, in resize
and found that the type of size
is dict
, not int
,The specific values are as follows:
size: {'shortest_edge': 224}
long=960
short=600
When I follow your steps to train, I always get the following error
KeyError: Caught KeyError in DataLoader worker process 0.
KeyError: 'text'
when install pytorch with cpu-only, and conduct training.
An error warning
FP16 Mixed precision training with AMP or APEX (--fp16
) and FP16 half precision evaluation (--fp16_full_eval
) can only be used on CUDA devices.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.