Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/110.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tensorflow 输入csv与他们一起培训_Tensorflow - Fatal编程技术网

Tensorflow 输入csv与他们一起培训

Tensorflow 输入csv与他们一起培训,tensorflow,Tensorflow,我有一个之前测试过的CNN模型。然而,我对导入自己的数据还不熟悉,而且不断出现错误。有谁能告诉我我做错了什么,以及导入数据以便模型运行的正确方法是什么?有没有我可以使用的资源,比如网上的书籍或指南 这是我目前的代码 code https://pastebin.com/wKtidYGL 测试csv为(62412000) 列车csv为(624362) 测试和训练标签也有(11999,1)和(361,1)Tensorflow开发人员制作了一系列有用的CSV处理函数,以便轻松地将它们反馈到您的训练模

我有一个之前测试过的CNN模型。然而,我对导入自己的数据还不熟悉,而且不断出现错误。有谁能告诉我我做错了什么,以及导入数据以便模型运行的正确方法是什么?有没有我可以使用的资源,比如网上的书籍或指南

这是我目前的代码

code

https://pastebin.com/wKtidYGL
测试csv为(62412000) 列车csv为(624362)
测试和训练标签也有(11999,1)和(361,1)

Tensorflow开发人员制作了一系列有用的CSV处理函数,以便轻松地将它们反馈到您的训练模型中

我建议阅读该官员的CSV部分


请在错误发生的地方发布错误和相关代码。错误出现在输入层之后,在输入层中,它表示它期望ndimm 3,但得到2。如何设置我的csv,以便它可以这样工作?我还对如何输入标签感到困惑。它们应该在同一个csv中吗?
import iris_data
train_path, test_path = iris_data.maybe_download()

ds = tf.data.TextLineDataset(train_path).skip(1)

# Metadata describing the text columns
COLUMNS = ['SepalLength', 'SepalWidth',
       'PetalLength', 'PetalWidth',
       'label']
FIELD_DEFAULTS = [[0.0], [0.0], [0.0], [0.0], [0]]

def _parse_line(line):
   # Decode the line into its fields
   fields = tf.decode_csv(line, FIELD_DEFAULTS)

   # Pack the result into a dictionary
   features = dict(zip(COLUMNS,fields))

   # Separate the label from the features
   label = features.pop('label')

   return features, label

   ds = ds.map(_parse_line)
   print(ds)