成功解决ValueError: Dimension 1 in both shapes must be equal, but are 1034 and 1024. Shapes are [100,103

简介: 成功解决ValueError: Dimension 1 in both shapes must be equal, but are 1034 and 1024. Shapes are [100,103

解决问题


ValueError: Dimension 1 in both shapes must be equal, but are 1034 and 1024. Shapes are [100,1034] and [100,1024]. for 'Assign_8' (op: 'Assign') with input shapes: [100,1034], [100,1024].





解决思路


值错误:两种形状的维度1必须相等,但是是1034和1024。形状为[100,1034]和[100,1024]。对于具有输入形状的'Assign_8' (op: 'Assign'):[100,1034],[100,1024]。





解决方法


读入的h5文件本身错误,需要重新训练得到最新的h5文件,然后导入读取即可!


g.load_weights('models/DCGAN1123.h5')


 

相关文章
|
5月前
|
机器学习/深度学习
RuntimeError mat1 and mat2 shapes cannot be multiplied
RuntimeError mat1 and mat2 shapes cannot be multiplied
416 0
|
5月前
|
Python
完美解决丨2. `TypeError: list indices must be integers or slices, not str`
完美解决丨2. `TypeError: list indices must be integers or slices, not str`
Minimal Square
Minimal Square
75 0
Minimal Square
|
机器学习/深度学习
Leetcode-Easy 887. Projection Area of 3D Shapes
Leetcode-Easy 887. Projection Area of 3D Shapes
127 0
Leetcode-Easy 887. Projection Area of 3D Shapes
成功解决ValueError: Dimension 1 in both shapes must be equal, but are 1034 and 1024. Shapes are [100,103
成功解决ValueError: Dimension 1 in both shapes must be equal, but are 1034 and 1024. Shapes are [100,103
成功解决ValueError: Cannot feed value of shape (1, 10, 4) for Tensor Placeholder:0 , which has shape
成功解决ValueError: Cannot feed value of shape (1, 10, 4) for Tensor Placeholder:0 , which has shape
Can not squeeze dim[1], expected a dimension of 1, got 21
Can not squeeze dim[1], expected a dimension of 1, got 21
465 0
ValueError: Error when checking : expected input_1 to have 4 dimensions, but got array with shape
ValueError: Error when checking : expected input_1 to have 4 dimensions, but got array with shape
391 0
|
索引 Python
成功解决ValueError: Shape of passed values is (33, 1), indices imply (33, 2)
成功解决ValueError: Shape of passed values is (33, 1), indices imply (33, 2)