当前位置:网站首页>解决ValueError: Argument must be a dense tensor: 0 - got shape [198602], but wanted [198602, 16].
解决ValueError: Argument must be a dense tensor: 0 - got shape [198602], but wanted [198602, 16].
2022-04-23 04:43:00 【小高高不要bug】
在Tensorflow中调用tf.data.Dataset.from_generator(generator_function,args=(values1,values2))(generator_function是自定义的生成器函数,args是生成器的输入参数) 时报出这个错误,找了一晚上,它实际是在这个位置报出的错误:

在tensor_util.py里的make_tensor_proto()函数的如下位置:

其中图片中的nparray = np.array(values, dtype=np_dt),这个values是生成器的输入参数values1,values2(有多少个参数会做多少次判断,values=values1,values=values2),上图中 _GetDenseDimensions(values) 函数的定义如下:

通过前后分析就可以发现,这个args里面的参数不能是列表的列表,可以是列表,也可以是字符串等,但是一旦是列表里面包含列表的参数就会报错。
版权声明
本文为[小高高不要bug]所创,转载请带上原文链接,感谢
https://blog.csdn.net/m0_46702604/article/details/124333256
边栏推荐
- Leetcode004 -- Roman numeral to integer
- Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15.
- leetcode003--判断一个整数是否为回文数
- No such file or directory problem while executing shell
- AWS EKS 部署要点以及控制台与eksctl创建的差异
- Last day of 2017
- What is a data island? Why is there still a data island in 2022?
- Brushless motor drive scheme based on Infineon MCU GTM module
- Inverse system of RC low pass filter
- Shanghai Hangxin technology sharing 𞓜 overview of safety characteristics of acm32 MCU
猜你喜欢

基于英飞凌MCU GTM模块的无刷电机驱动方案开源啦

Druid -- JDBC tool class case

229. 求众数 II

Brushless motor drive scheme based on Infineon MCU GTM module

Installation and use of Apache bench (AB pressure test tool)

zynq平台交叉编译器的安装

简单的拖拽物体到物品栏

Bacterial infection and antibiotic use

Recursive call -- Enumeration of permutations

Use recyclerview to realize left-right side-by-side classification selection
随机推荐
Leetcode003 -- judge whether an integer is a palindrome number
The perfect combination of collaborative process and multi process
Recursive call -- Enumeration of permutations
Logger and zap log Library in go language
Gut liver axis: host microbiota interaction affects hepatocarcinogenesis
第四章 --- 了解标准设备文件、过滤器和管道
【Pytorch基础】torch.split()用法
Apache Bench(ab 压力测试工具)的安装与使用
Fusobacterium -- symbiotic bacteria, opportunistic bacteria, oncobacterium
SQL statement for adding columns in MySQL table
Installation of zynq platform cross compiler
leetcode006--查找字符串数组中的最长公共前缀
Solutions to the failure of sqoop connection to MySQL
在AWS控制台创建VPC(无图版)
unity摄像机旋转带有滑动效果(自转)
Key points of AWS eks deployment and differences between console and eksctl creation
补充番外14:cmake实践项目笔记(未完待续4/22)
Leetcode001 -- returns the subscript of the array element whose sum is target
Chapter 4 - understanding standard equipment documents, filters and pipelines
Alibaba tip: it is better to create threads manually