Giter VIP home page Giter VIP logo

clip-chinese's Issues

是否需要微调

您好!我想用您的模型来对本地数据集进行图文相似度计算。请问是否需要进行微调呢?谢谢!

你好,我遇到了没有cuda的问题

你好,我遇到了没有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

是版本不兼容吗?

TypeError: unsupported operand type(s) for *: 'dict' and 'int'

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

KeyError: 'text'

When I follow your steps to train, I always get the following error

KeyError: Caught KeyError in DataLoader worker process 0.
KeyError: 'text'

Can I use CPU for training?

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.

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.