当前位置: 首页 > news >正文

wordpress 获取网站地址制作一个简单的网站

wordpress 获取网站地址,制作一个简单的网站,郴州市做网站,网站建设需注意点问题描述: 在训练模型的过程中,出现 clip_image_processor 无法处理数据的问题,说明数据集中很可能出现了脏数据。本文使用的数据为 LAION-Aesthetics-V2-6.5plus,从 https://dagshub.com/DagsHub-Datasets/LAION-Aesthetics-V2-…

问题描述:

  1. 在训练模型的过程中,出现 clip_image_processor 无法处理数据的问题,说明数据集中很可能出现了脏数据。
  2. 本文使用的数据为 LAION-Aesthetics-V2-6.5plus,从 https://dagshub.com/DagsHub-Datasets/LAION-Aesthetics-V2-6.5plus 上下载的。
Traceback (most recent call last):
...File "/xxx/check_train_data.py", line 69, in __getitem__raise e  # Re-raise the exception to halt the training process^^^^^^^File "/xxx/check_train_data.py", line 64, in __getitem__clip_image = self.clip_image_processor(images=raw_image, return_tensors="pt").pixel_values^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/xxx/lib/python3.12/site-packages/transformers/image_processing_utils.py", line 41, in __call__return self.preprocess(images, **kwargs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/xxx/lib/python3.12/site-packages/transformers/models/clip/image_processing_clip.py", line 341, in preprocessself.normalize(image=image, mean=image_mean, std=image_std, input_data_format=input_data_format)File "/xxx/lib/python3.12/site-packages/transformers/image_processing_utils.py", line 111, in normalizereturn normalize(^^^^^^^^^^File "/xxx/lib/python3.12/site-packages/transformers/image_transforms.py", line 392, in normalizeraise ValueError(f"mean must have {num_channels} elements if it is an iterable, got {len(mean)}")
ValueError: mean must have 1 elements if it is an iterable, got 3

解决方案:

  1. 将原代码的 clip_image = self.clip_image_processor 修改为 try、except 来找到导致报错的图片。
  2. 将加载数据的代码部分拎出,并遍历一遍。
 # read imageraw_image = Image.open(os.path.join(self.image_root_path, image_file))image = self.transform(raw_image.convert("RGB"))# clip_image = self.clip_image_processor(images=raw_image, return_tensors="pt").pixel_valuestry:clip_image = self.clip_image_processor(images=raw_image, return_tensors="pt").pixel_valuesprint(f'image_file_{idx} processed with clip_image_processor: {image_file}')except Exception as e:print(f'Error processing image_file_{idx}: {image_file}')print(e)raise e  # Re-raise the exception to halt the training process
  1. 最终卡在 4235 附近的图片,通过肉眼观察,发现 4236 是图片空的😂
  2. 手动删除 4236 图片以及对应的 json 文本后便可正常训练!🏋️
    在这里插入图片描述
http://www.yidumall.com/news/69010.html

相关文章:

  • 网络建站优化科技棋牌软件制作开发多少钱
  • 西山区城市建设局网站2022年网络流行语
  • 婚纱摄影网站的设计与实现搜狗排名优化工具
  • 专业网站建设公司 1861web域名注册服务网站
  • 新疆住房和城乡建设局网站站点
  • 深圳最好的网站建设全媒体广告代理加盟
  • 手表专卖网阳西网站seo
  • 网站建设亿码酷出名5宁波seo在线优化
  • 用dw做网站首页步骤搜索引擎推广的常见形式有
  • 遵义网站开发制作公司北京网站维护公司
  • 中国建设银行 云南 网站首页抖音seo排名
  • 毕业设计网站建设产品网络推广
  • 设计logo网站侵权吗知乎网络营销方案设计毕业设计
  • 手机门户WordPress主题惠州抖音seo
  • 做网站 用什么做数据库最好百度平台官网
  • 具有营销型网站的公司有哪些西安网站seo工作室
  • 在pc端网站基础上做移动端包括哪些内容
  • 云南网站备案系统南京网站制作公司
  • 网站后台怎么修改密码揭阳seo快速排名
  • 电子商务平台是什么aso优化违法吗
  • 河南教育平台网站建设营销策划思路
  • html加css漂亮页面源码企业网站优化关键词
  • 同城网站开发永久不收费的软件app
  • 南阳专业做网站公司哪家好公司官网制作开发
  • cms系统java网站优化怎么操作
  • 西宁做网站的好公司推广网站推广
  • 动态网站设计要求太原网站推广公司
  • 房产中介网站开发模板百度用户服务中心官网电话
  • 网站默认中文字体陕西网站推广公司
  • 邯郸高端网站建设价格西安seo排名外包