简体   繁体   English

矩阵大小不兼容:In[0]:[47,1000],In[1]:[4096,256]

[英]Matrix size-incompatible: In[0]: [47,1000], In[1]: [4096,256]

I'm new to TensorFlow and am following a tutorial.我是 TensorFlow 的新手,正在学习教程。 I'm trying to do image captioning using VGG.我正在尝试使用 VGG 进行图像字幕。 I am getting an error that says:我收到一条错误消息:

enter image description here在此处输入图像描述

This is my code:这是我的代码:

model = define_model(vocab_size, max_length)  
epochs = 20

steps = len(train_descriptions)

for i in range(epochs):
    generator = data_generator(train_descriptions, train_features, tokenizer, max_length)
    model.fit_generator(generator, epochs=1, steps_per_epoch=steps, verbose=1)
    model.save('model_' + str(i) + '.h5')

I'm just following the tutorial but that video was taken a long time ago.我只是按照教程进行操作,但该视频是很久以前拍摄的。 Since I'm new to this I don't understand this error.因为我是新手,所以我不明白这个错误。 I tried model.fit() also.我也试过model.fit() But, nothing works.但是,没有任何效果。 Please, help me to rectify this.请帮我纠正这个问题。

https://github.com/nitinkaushik01/Deep_and_Machine_Learning_Projects/blob/master/Image_Caption_Project/Image_caption_Project.ipynb - This is the tutorial I'm following. https://github.com/nitinkaushik01/Deep_and_Machine_Learning_Projects/blob/master/Image_Caption_Project/Image_caption_Project.ipynb - 这是我正在关注的教程。

  1. solved after apply the below modification inputs1 --> 1000 instead of 4096 se1 --> 47 instead of 256 decoder2 --> 47 instead of 256 fe2 --> 47 instead of 256 se3 --> 47 instead of 256在应用以下修改之后解决了输入1 --> 1000 而不是 4096 se1 --> 47 而不是 256 解码器2 --> 47 而不是 256 fe2 --> 47 而不是 256 se3 --> 47 而不是 256
  2. or just update inputs1 to 1000 i think it will solve the issue或者只是将输入 1 更新为 1000 我认为它会解决问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Tensorflow:张量上的矩阵大小不兼容错误 - Tensorflow: Matrix size-incompatible error on Tensors 矩阵尺寸不兼容 - Keras Tensorflow - Matrix size-incompatible - Keras Tensorflow 尝试创建GAN:InvalidArgumentError:矩阵大小不兼容 - Trying to create GAN: InvalidArgumentError: Matrix size-incompatible Keras Model.predict 返回错误“矩阵大小不兼容” - Keras Model.predict returns the error 'Matrix size-incompatible' Tensorflow keras 矩阵大小与极其简单的模型不兼容 - Tensorflow keras Matrix size-incompatible with extremely simple model 矩阵大小不兼容:DCGAN 中的 In[0]: [16,1024], In[1]: [16384,1] - Matrix size-incompatible: In[0]: [16,1024], In[1]: [16384,1] in DCGAN InvalidArgumentError: 矩阵大小不兼容: In[0]: [32,21], In[1]: [128,1] - InvalidArgumentError: Matrix size-incompatible: In[0]: [32,21], In[1]: [128,1] 如何解决此错误:矩阵大小不兼容:在[0]:[1,786432],在[1]中:[784,512] [[{{node MatMul}}]]> - How to solve this error: Matrix size-incompatible: In[0]: [1,786432], In[1]: [784,512] [[{{node MatMul}}]]> Keras Python脚本有时运行正常,有时会因Matrix大小不兼容而失败:在[0]:[10000,1],In [1]:[3,1] - Keras Python script sometimes runs fine, sometimes fails with Matrix size-incompatible: In[0]: [10000,1], In[1]: [3,1] 为什么删除张量中的一维会导致InvalidArgumentError:矩阵大小不兼容? - Why deleting one dimension in tensor causes InvalidArgumentError: Matrix size-incompatible?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM