成功解决TypeError: Value passed to parameter 'paddings' has DataType float32 not in list of allowed valu

简介: 成功解决TypeError: Value passed to parameter 'paddings' has DataType float32 not in list of allowed valu

解决问题


TypeError: Value passed to parameter 'paddings' has DataType float32 not in list of allowed values: int32, int64



解决思路


类型错误:传递给参数“paddings”的值,不包含允许的值列表中的数据类型, int32, int64,这两种类型

对类型进行转换:强制转换为int类型



解决方法


建议采用np的int类型转换!


x_padded = tf.pad(x, [[0, 0], [np.int(kernel / 2), np.int(kernel / 2)], [np.int(kernel / 2), np.int(kernel / 2)], [0, 0]], mode=mode)

哈哈,成功运行,大功告成!



相关文章
|
SQL Java 数据库连接
mybatis 使用foreach时出现“The expression ‘list‘ evaluated to a null value“问题
mybatis 使用foreach时出现“The expression ‘list‘ evaluated to a null value“问题
1354 3
|
1月前
|
Python
stack=s+stack#TypeError: can only concatenate str (not “list“) to str
stack=s+stack#TypeError: can only concatenate str (not “list“) to str
|
1月前
|
开发者 Python
【Python】已解决:TypeError: descriptor ‘index‘ for ‘list‘ objects doesn‘t apply to a ‘str‘ object
【Python】已解决:TypeError: descriptor ‘index‘ for ‘list‘ objects doesn‘t apply to a ‘str‘ object
35 0
|
2月前
|
存储 NoSQL 安全
Redis第六弹-List列表-(相当于数组/顺序表)Lpush key element-一次可以插入多个元素(假如key已经存在,并且key对应的value并非是list,则会报错)
Redis第六弹-List列表-(相当于数组/顺序表)Lpush key element-一次可以插入多个元素(假如key已经存在,并且key对应的value并非是list,则会报错)
|
3月前
|
JavaScript
Vue报错 Invalid default value for prop “list“: Props with type Object/Array must use a factory
Vue报错 Invalid default value for prop “list“: Props with type Object/Array must use a factory
202 0
|
3月前
|
Java API
List转Map(id为key,list为value)
List转Map(id为key,list为value)
130 0
|
3月前
|
JSON 数据格式 Python
TypeError the JSON object must be str, bytes or bytearray, not ‘list‘
TypeError the JSON object must be str, bytes or bytearray, not ‘list‘
146 1
|
SQL
Parameter ‘id‘ not found. Available parameters are [collection, list]
Parameter ‘id‘ not found. Available parameters are [collection, list]
175 0
|
Java 数据库连接 mybatis
mybatis关于出现Parameter ‘XXX‘ not found. Available parameters are [collection, list]问题的解决方案
mybatis关于出现Parameter ‘XXX‘ not found. Available parameters are [collection, list]问题的解决方案
783 0