tensorflow - 具有扩展批量形状的 Keras Conv2D
问题描述
您好,我正在尝试使用 keras Conv2D的最后一个示例
# With extended batch shape [4, 7]:
import tensorflow as tf
input_shape = (4, 7, 127, 127, 3)
x = tf.random.normal(input_shape)
y = tf.keras.layers.Conv2D(2, 3, activation='relu', input_shape=input_shape[2:])(x)
print(y.shape)
但是我收到了一个形状错误:
ValueError: Input 0 of layer conv2d_11 is incompatible with the layer: expected ndim=4, found ndim=5. Full shape received: [4, 7, 127, 127, 3]
解决方案
推荐阅读
- javascript - 添加对象数组以形成数据
- javascript - 如何使用 Javascript 更改 @font-face 源?
- python - 通过 Heroku 写入 GitHub 上的文件
- r - 选择日期/时间单元格时如何强制 R 保持时间值?
- javascript - 我如何理解 Redux 购物车示例中的这个默认语句?
- java - 仅当显式请求注释处理时才接受类名“介绍”
- c - (Manjaro Linux)OpenMPI 不运行任何类型的已编译 C 多进程程序
- python - 我如何未能将项目添加到列表中?
- http - groovy 参数重复并用 '&' 分隔
- sql - PostgreSQL:唯一约束或唯一索引