Failed to parse value [4] for setting [thread_pool.write.size] must be <= 2

时间: 2023-12-10 19:36:50 浏览: 50
这个错误提示是 Elasticsearch 的设置错误。它告诉我们,`thread_pool.write.size` 的值必须小于或等于 2。这个设置控制了写入操作的线程池中的线程数。如果你想要修改这个设置,可以通过在 Elasticsearch 的配置文件中设置 `thread_pool.write.size` 来实现。例如,将其设置为 2: ``` thread_pool.write.size: 2 ``` 如果你已经设置了这个值,但仍然出现这个错误,那么可能是由于其他设置引起的冲突。你可以参考 Elasticsearch 的官方文档,查找可能会影响该设置的其他设置,并进行相应的修改。
相关问题

Elasticsearch exception [type=illegal_argument_exception, reason=Failed to parse value [0] for setting [index.number_of_shards] must be >= 1

这个错误意味着在Elasticsearch中,索引的分片数需要大于等于1,但是你设置的值为0或负数了。你需要将index.number_of_shards的值修改为大于等于1的整数值,例如: PUT /my_index { "settings": { "index.number_of_shards": 1 } } 这样就可以将分片数设置为1了。如果你需要更多的分片,可以适当增加这个值。

规范代码:读取数据源表格 ori_excel = openpyxl.load_workbook(ori_excel_path) ori_sheet = ori_excel.active rows = ori_sheet.max_row cols = ori_sheet.max_column 加载公式解析器 from transformers import AutoTokenizer tokenizer = AutoTokenizer.from_pretrained("microsoft/CodeGPT-small-py") 遍历每一行 for r in range(2, rows + 1): info = {} # 定义一个字典用来存放数据 mould_excel = openpyxl.load_workbook(mould_excel_path) mould_sheet = mould_excel.active # 遍历每一列 for c in range(1, cols + 1): # 如果标题栏和单元格内有内容 ori_cell_value = ori_sheet.cell(1, c).value cell_value = ori_sheet.cell(r, c).value if ori_cell_value and cell_value: # 获取单元格数据类型和值 data_type = ori_sheet.cell(r, c).data_type value = cell_value # 如果单元格内是函数公式,则运算后写入 if data_type == 'f': # 公式解析 tokens = [str(token.value) if token.type == Token.NUMBER else repr(token.value) for token in tokenizer.parse(value)] # 运算 result = calculate(tokens) # 写入结果 mould_sheet.cell(row=r, column=c).value = result else: # 直接写入值 mould_sheet.cell(row=r, column=c).value = value # 将计算结果写入到模板表格 if data_type == 'f': mould_sheet.cell(row=r, column=c, value=result) else: mould_sheet.cell(row=r, column=c, value=value) else: # 如果单元格内不是函数公式,则直接写入 info[ori_cell_value] = cell_value mould_sheet.cell(row=r, column=c, value=cell_value)

下面是规范化后的代码: ```python import openpyxl from transformers import AutoTokenizer # 读取数据源表格 ori_excel = openpyxl.load_workbook(ori_excel_path) ori_sheet = ori_excel.active rows = ori_sheet.max_row cols = ori_sheet.max_column # 加载公式解析器 tokenizer = AutoTokenizer.from_pretrained("microsoft/CodeGPT-small-py") # 遍历每一行 for r in range(2, rows + 1): info = {} # 定义一个字典用来存放数据 mould_excel = openpyxl.load_workbook(mould_excel_path) mould_sheet = mould_excel.active # 遍历每一列 for c in range(1, cols + 1): # 如果标题栏和单元格内有内容 ori_cell_value = ori_sheet.cell(1, c).value cell_value = ori_sheet.cell(r, c).value if ori_cell_value and cell_value: # 获取单元格数据类型和值 data_type = ori_sheet.cell(r, c).data_type value = cell_value # 如果单元格内是函数公式,则运算后写入 if data_type == 'f': # 公式解析 tokens = [str(token.value) if token.type == Token.NUMBER else repr(token.value) for token in tokenizer.parse(value)] # 运算 result = calculate(tokens) # 写入结果 mould_sheet.cell(row=r, column=c).value = result else: # 直接写入值 mould_sheet.cell(row=r, column=c).value = value # 将计算结果写入到模板表格 if data_type == 'f': mould_sheet.cell(row=r, column=c, value=result) else: mould_sheet.cell(row=r, column=c, value=value) else: # 如果单元格内不是函数公式,则直接写入 info[ori_cell_value] = cell_value mould_sheet.cell(row=r, column=c, value=cell_value) ```

相关推荐

import tensorflow as tf from im_dataset import train_image, train_label, test_image, test_label from AlexNet8 import AlexNet8 from baseline import baseline from InceptionNet import Inception10 from Resnet18 import ResNet18 import os import matplotlib.pyplot as plt import argparse import numpy as np parse = argparse.ArgumentParser(description="CVAE model for generation of metamaterial") hyperparameter_set = parse.add_argument_group(title='HyperParameter Setting') dim_set = parse.add_argument_group(title='Dim setting') hyperparameter_set.add_argument("--num_epochs",type=int,default=200,help="Number of train epochs") hyperparameter_set.add_argument("--learning_rate",type=float,default=4e-3,help="learning rate") hyperparameter_set.add_argument("--image_size",type=int,default=16*16,help="vector size of image") hyperparameter_set.add_argument("--batch_size",type=int,default=16,help="batch size of database") dim_set.add_argument("--z_dim",type=int,default=20,help="dim of latent variable") dim_set.add_argument("--feature_dim",type=int,default=32,help="dim of feature vector") dim_set.add_argument("--phase_curve_dim",type=int,default=41,help="dim of phase curve vector") dim_set.add_argument("--image_dim",type=int,default=16,help="image size: [image_dim,image_dim,1]") args = parse.parse_args() def preprocess(x, y): x = tf.io.read_file(x) x = tf.image.decode_png(x, channels=1) x = tf.cast(x,dtype=tf.float32) /255. x1 = tf.concat([x, x], 0) x2 = tf.concat([x1, x1], 1) x = x - 0.5 y = tf.convert_to_tensor(y) y = tf.cast(y,dtype=tf.float32) return x2, y train_db = tf.data.Dataset.from_tensor_slices((train_image, train_label)) train_db = train_db.shuffle(100).map(preprocess).batch(args.batch_size) test_db = tf.data.Dataset.from_tensor_slices((test_image, test_label)) test_db = test_db.map(preprocess).batch(args.batch_size) model = ResNet18([2, 2, 2, 2]) model.build(input_shape=(args.batch_size, 32, 32, 1)) model.compile(optimizer = tf.keras.optimizers.Adam(lr = 1e-3), loss = tf.keras.losses.MSE, metrics = ['MSE']) checkpoint_save_path = "./checkpoint/InceptionNet_im_3/checkpoint.ckpt" if os.path.exists(checkpoint_save_path+'.index'): print('------------------load the model---------------------') model.load_weights(checkpoint_save_path) cp_callback = tf.keras.callbacks.ModelCheckpoint(filepath=checkpoint_save_path,save_weights_only=True,save_best_only=True) history = model.fit(train_db, epochs=500, validation_data=test_db, validation_freq=1, callbacks=[cp_callback]) model.summary() acc = history.history['loss'] val_acc = history.history['val_loss'] plt.plot(acc, label='Training MSE') plt.plot(val_acc, label='Validation MSE') plt.title('Training and Validation MSE') plt.legend() plt.show()

最新推荐

recommend-type

Jboss启动报Failed to parse WEB-INFweb.xml; - nested throwable错误

Jboss启动报Failed to parse WEB-INFweb.xml; - nested throwable错误
recommend-type

谈谈JSON对象和字符串之间的相互转换JSON.stringify(obj)和JSON.parse(string)

主要介绍了谈谈JSON对象和字符串之间的相互转换JSON.stringify(obj)和JSON.parse(string)以及JSON的parse()和stringfy()方法详解,感兴趣的朋友一起看看吧
recommend-type

zigbee-cluster-library-specification

最新的zigbee-cluster-library-specification说明文档。
recommend-type

管理建模和仿真的文件

管理Boualem Benatallah引用此版本:布阿利姆·贝纳塔拉。管理建模和仿真。约瑟夫-傅立叶大学-格勒诺布尔第一大学,1996年。法语。NNT:电话:00345357HAL ID:电话:00345357https://theses.hal.science/tel-003453572008年12月9日提交HAL是一个多学科的开放存取档案馆,用于存放和传播科学研究论文,无论它们是否被公开。论文可以来自法国或国外的教学和研究机构,也可以来自公共或私人研究中心。L’archive ouverte pluridisciplinaire
recommend-type

实现实时数据湖架构:Kafka与Hive集成

![实现实时数据湖架构:Kafka与Hive集成](https://img-blog.csdnimg.cn/img_convert/10eb2e6972b3b6086286fc64c0b3ee41.jpeg) # 1. 实时数据湖架构概述** 实时数据湖是一种现代数据管理架构,它允许企业以低延迟的方式收集、存储和处理大量数据。与传统数据仓库不同,实时数据湖不依赖于预先定义的模式,而是采用灵活的架构,可以处理各种数据类型和格式。这种架构为企业提供了以下优势: - **实时洞察:**实时数据湖允许企业访问最新的数据,从而做出更明智的决策。 - **数据民主化:**实时数据湖使各种利益相关者都可
recommend-type

2. 通过python绘制y=e-xsin(2πx)图像

可以使用matplotlib库来绘制这个函数的图像。以下是一段示例代码: ```python import numpy as np import matplotlib.pyplot as plt def func(x): return np.exp(-x) * np.sin(2 * np.pi * x) x = np.linspace(0, 5, 500) y = func(x) plt.plot(x, y) plt.xlabel('x') plt.ylabel('y') plt.title('y = e^{-x} sin(2πx)') plt.show() ``` 运行这段
recommend-type

JSBSim Reference Manual

JSBSim参考手册,其中包含JSBSim简介,JSBSim配置文件xml的编写语法,编程手册以及一些应用实例等。其中有部分内容还没有写完,估计有生之年很难看到完整版了,但是内容还是很有参考价值的。
recommend-type

"互动学习:行动中的多样性与论文攻读经历"

多样性她- 事实上SCI NCES你的时间表ECOLEDO C Tora SC和NCESPOUR l’Ingén学习互动,互动学习以行动为中心的强化学习学会互动,互动学习,以行动为中心的强化学习计算机科学博士论文于2021年9月28日在Villeneuve d'Asq公开支持马修·瑟林评审团主席法布里斯·勒菲弗尔阿维尼翁大学教授论文指导奥利维尔·皮耶昆谷歌研究教授:智囊团论文联合主任菲利普·普雷教授,大学。里尔/CRISTAL/因里亚报告员奥利维耶·西格德索邦大学报告员卢多维奇·德诺耶教授,Facebook /索邦大学审查员越南圣迈IMT Atlantic高级讲师邀请弗洛里安·斯特鲁布博士,Deepmind对于那些及时看到自己错误的人...3谢谢你首先,我要感谢我的两位博士生导师Olivier和Philippe。奥利维尔,"站在巨人的肩膀上"这句话对你来说完全有意义了。从科学上讲,你知道在这篇论文的(许多)错误中,你是我可以依
recommend-type

实现实时监控告警系统:Kafka与Grafana整合

![实现实时监控告警系统:Kafka与Grafana整合](https://imgconvert.csdnimg.cn/aHR0cHM6Ly9tbWJpei5xcGljLmNuL21tYml6X2pwZy9BVldpY3ladXVDbEZpY1pLWmw2bUVaWXFUcEdLT1VDdkxRSmQxZXB5R1lxaWNlUjA2c0hFek5Qc3FyRktudFF1VDMxQVl3QTRXV2lhSWFRMEFRc0I1cW1ZOGcvNjQw?x-oss-process=image/format,png) # 1.1 Kafka集群架构 Kafka集群由多个称为代理的服务器组成,这
recommend-type

导入numpy库,创建两个包含9个随机数的3*3的矩阵,将两个矩阵分别打印出来,计算两个数组的点积并打印出来。(random.randn()、dot()函数)

可以的,以下是代码实现: ```python import numpy as np # 创建两个包含9个随机数的3*3的矩阵 matrix1 = np.random.randn(3, 3) matrix2 = np.random.randn(3, 3) # 打印两个矩阵 print("Matrix 1:\n", matrix1) print("Matrix 2:\n", matrix2) # 计算两个数组的点积并打印出来 dot_product = np.dot(matrix1, matrix2) print("Dot product:\n", dot_product) ``` 希望