当前位置: 代码迷 >> 综合 >> 解决ValueError: Shape must be rank 1 but is rank 0 for ‘bn_conv1/Reshape_4’ (op: ‘Reshape’) with input
  详细解决方案

解决ValueError: Shape must be rank 1 but is rank 0 for ‘bn_conv1/Reshape_4’ (op: ‘Reshape’) with input

热度:91   发布时间:2023-10-18 13:35:51.0

解决:ValueError: Shape must be rank 1 but is rank 0 for ‘bn_conv1/Reshape_4’ (op: ‘Reshape’) with input shapes: [1,1,1,64], [].

情况:keras-gpu版本,后端为tensorflow配置环境问题
解决方法
第一步: 找到tensorflow_backend.py文件
解决ValueError: Shape must be rank 1 but is rank 0 for ‘bn_conv1/Reshape_4’ (op: ‘Reshape’) with input
如果有很多tensorflow_backend.py文件,建议所有的都改一下
第二步:修改文件:
解决ValueError: Shape must be rank 1 but is rank 0 for ‘bn_conv1/Reshape_4’ (op: ‘Reshape’) with input
把这些行中的(-1)改成中括号[-1],图片是我改过的.这个是2.2.4版bn层源码错误…

  相关解决方案